Merge pull request #776 from AldoMX/master

Added `select_all` method to `TextInput`.
This commit is contained in:
Héctor Ramón 2021-07-22 20:48:03 +07:00 committed by GitHub
commit 587dbbca42
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 1 deletions

View file

@ -786,6 +786,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