Expose focus method for otp input (#83)
This commit is contained in:
parent
66698bfe27
commit
97d139f9ec
1 changed files with 4 additions and 0 deletions
|
|
@ -68,6 +68,10 @@ impl OtpInput {
|
||||||
self
|
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>) {
|
fn on_input_mouse_down(&mut self, _: &MouseDownEvent, cx: &mut ViewContext<Self>) {
|
||||||
cx.focus(&self.focus_handle);
|
cx.focus(&self.focus_handle);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue