summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--native/src/widget/text_input.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/native/src/widget/text_input.rs b/native/src/widget/text_input.rs
index 64182f2d..7af59ba1 100644
--- a/native/src/widget/text_input.rs
+++ b/native/src/widget/text_input.rs
@@ -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