Add textinput focus method

This commit is contained in:
Paul Delafosse 2020-11-06 08:20:03 +01:00 committed by Héctor Ramón Jiménez
parent da1a3eed1e
commit f7d67598cb

View File

@ -716,6 +716,12 @@ impl State {
pub fn move_cursor_to(&mut self, position: usize) {
self.cursor.move_to(position);
}
/// Change the focus of the [`TextInput`] state.
/// [`TextInput`]: struct.TextInput.html
pub fn focus(&mut self, state: bool) {
self.is_focused = state
}
}
// TODO: Reduce allocations