Skip to content

Commit

Permalink
Expose focus method for otp input
Browse files Browse the repository at this point in the history
  • Loading branch information
madcodelife committed Jul 29, 2024
1 parent 66698bf commit d502b37
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions crates/ui/src/input/otp_input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ impl OtpInput {
self
}

pub fn focus(&self, cx: &mut ViewContext<Self>) {
self.focus_handle.focus(cx);
}

fn on_input_mouse_down(&mut self, _: &MouseDownEvent, cx: &mut ViewContext<Self>) {
cx.focus(&self.focus_handle);
}
Expand Down

0 comments on commit d502b37

Please sign in to comment.