diff options
| author | alex-ds13 <145657253+alex-ds13@users.noreply.github.com> | 2025-12-04 03:12:37 +0000 |
|---|---|---|
| committer | Polesznyák Márk <contact@pml68.dev> | 2025-12-30 18:13:59 +0100 |
| commit | 1b54e952d15fafac0c086f8312a6c3c64c9d120b (patch) | |
| tree | 72a85ae141ea7d1d3ebc3f0028608c0b04caf9fd /src/lib.rs | |
| parent | feat(selectable): draft implementation of selectable widget (diff) | |
| download | iced_selection-1b54e952d15fafac0c086f8312a6c3c64c9d120b.tar.gz | |
fix(selectable): update docs with warning about selectable usage
Diffstat (limited to '')
| -rw-r--r-- | src/lib.rs | 13 |
1 files changed, 12 insertions, 1 deletions
@@ -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 |
