Merge pull request #598 from oknozor/input-text-focus
Add textinput focus method
This commit is contained in:
commit
d0402d072d
|
@ -693,6 +693,20 @@ impl State {
|
||||||
self.cursor
|
self.cursor
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Focuses the [`TextInput`].
|
||||||
|
///
|
||||||
|
/// [`TextInput`]: struct.TextInput.html
|
||||||
|
pub fn focus(&mut self) {
|
||||||
|
self.is_focused = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Unfocuses the [`TextInput`].
|
||||||
|
///
|
||||||
|
/// [`TextInput`]: struct.TextInput.html
|
||||||
|
pub fn unfocus(&mut self) {
|
||||||
|
self.is_focused = false;
|
||||||
|
}
|
||||||
|
|
||||||
/// Moves the [`Cursor`] of the [`TextInput`] to the front of the input text.
|
/// Moves the [`Cursor`] of the [`TextInput`] to the front of the input text.
|
||||||
///
|
///
|
||||||
/// [`Cursor`]: struct.Cursor.html
|
/// [`Cursor`]: struct.Cursor.html
|
||||||
|
|
Loading…
Reference in New Issue