fix(editable_input): disable edit mode when widget loses focus
This commit is contained in:
parent
0d829886fe
commit
c6ab6cfe23
1 changed files with 8 additions and 0 deletions
|
|
@ -719,6 +719,14 @@ where
|
|||
let line_height = self.line_height;
|
||||
|
||||
if self.is_editable {
|
||||
if let Some(ref on_edit) = self.on_toggle_edit {
|
||||
let state = tree.state.downcast_mut::<State>();
|
||||
if !state.is_read_only && state.is_focused.is_none() {
|
||||
state.is_read_only = true;
|
||||
shell.publish((on_edit)(false));
|
||||
}
|
||||
}
|
||||
|
||||
let index = tree.children.len() - 1;
|
||||
if let (Some(trailing_icon), Some(tree)) =
|
||||
(self.trailing_icon.as_mut(), tree.children.get_mut(index))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue