Expose focus method for otp input (#83)

This commit is contained in:
Floyd Wang 2024-07-29 16:20:58 +08:00 committed by GitHub
parent 66698bfe27
commit 97d139f9ec
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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);
}