diff options
author | 2021-03-13 14:50:59 -0600 | |
---|---|---|
committer | 2021-03-13 14:50:59 -0600 | |
commit | 57247106b95acb120381305cbe1ab4077b17651f (patch) | |
tree | e93339c25ae8a11253b54eaa34b12dbe49759e41 /native | |
parent | c1f70f1e9252b1971c17cd385273460c669fac26 (diff) | |
download | iced-57247106b95acb120381305cbe1ab4077b17651f.tar.gz iced-57247106b95acb120381305cbe1ab4077b17651f.tar.bz2 iced-57247106b95acb120381305cbe1ab4077b17651f.zip |
Added `select_all` method to `TextInput`.
Diffstat (limited to 'native')
-rw-r--r-- | native/src/widget/text_input.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/native/src/widget/text_input.rs b/native/src/widget/text_input.rs index de6032b7..2a0913f3 100644 --- a/native/src/widget/text_input.rs +++ b/native/src/widget/text_input.rs @@ -792,6 +792,11 @@ impl State { pub fn move_cursor_to(&mut self, position: usize) { self.cursor.move_to(position); } + + /// Selects all the content of the [`TextInput`]. + pub fn select_all(&mut self) { + self.cursor.select_range(0, usize::MAX); + } } // TODO: Reduce allocations |