aboutsummaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
authoralex-ds13 <145657253+alex-ds13@users.noreply.github.com>2025-12-04 03:12:37 +0000
committerPolesznyák Márk <contact@pml68.dev>2025-12-30 18:13:59 +0100
commit1b54e952d15fafac0c086f8312a6c3c64c9d120b (patch)
tree72a85ae141ea7d1d3ebc3f0028608c0b04caf9fd /src/lib.rs
parentfeat(selectable): draft implementation of selectable widget (diff)
downloadiced_selection-1b54e952d15fafac0c086f8312a6c3c64c9d120b.tar.gz
fix(selectable): update docs with warning about selectable usage
Diffstat (limited to '')
-rw-r--r--src/lib.rs13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/lib.rs b/src/lib.rs
index c1c41cf..d108c17 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -229,9 +229,20 @@ pub fn span<'a, Link>(
text::Span::new(text)
}
-/// Creates some [`Selectable`] with the given content.
+/// Creates some [`Selectable`] with the given content. This [`Selectable`] will make all inner
+/// [`Text`] or [`Rich`] change their behavior from an independent selectable to a global
+/// selectable which makes it so you can select across widgets and start selections out of bounds
+/// of widgets. This [`Selectable`] will also handle the 'ctrl + c' shortcut by getting all the
+/// selected text inside it and write it to the clipboard.
+///
+/// WARNING: You should only have one [`Selectable`] on your app, preferrably as the root of your
+/// app to make sure that any [`Text`] or [`Rich`] is inside it. Having multiple selectables or a
+/// selectable along side some [`Text`] or [`Rich`] is undefined behavior and even though the
+/// selection might look ok for you the copied text will probably not be what you expect.
///
/// [`Selectable`]: crate::selectable::Selectable
+/// [`Text`]: crate::Text
+/// [`Rich`]: crate::text::Rich
///
/// # Example
/// ```no_run,ignore