Skip to content

Commit

Permalink
Focus textbox when StartEdit event is received
Browse files Browse the repository at this point in the history
  • Loading branch information
geom3trik committed Jun 17, 2022
1 parent e83adc6 commit 096ae26
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions core/src/views/textbox.rs
Original file line number Diff line number Diff line change
Expand Up @@ -336,13 +336,18 @@ impl Model for TextboxData {
if !cx.is_disabled() {
if !self.edit {
self.edit = true;
cx.focus();
cx.capture();
cx.set_checked(true);
cx.emit(TextEvent::SelectAll);
}
}
}

TextEvent::EndEdit => {
self.edit = false;
cx.set_checked(false);
cx.release();
}

TextEvent::Submit(flag) => {
Expand Down

0 comments on commit 096ae26

Please sign in to comment.