Unfocus TextInput if it becomes disabled
This commit is contained in:
parent
250ba3a7f1
commit
7e69cb4b18
1 changed files with 12 additions and 0 deletions
|
|
@ -227,6 +227,18 @@ where
|
||||||
tree::State::new(State::new())
|
tree::State::new(State::new())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn diff(&self, tree: &mut Tree) {
|
||||||
|
let state = tree.state.downcast_mut::<State>();
|
||||||
|
|
||||||
|
// Unfocus text input if it becomes disabled
|
||||||
|
if self.on_input.is_none() {
|
||||||
|
state.last_click = None;
|
||||||
|
state.is_focused = None;
|
||||||
|
state.is_pasting = None;
|
||||||
|
state.is_dragging = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fn width(&self) -> Length {
|
fn width(&self) -> Length {
|
||||||
self.width
|
self.width
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue