diff options
author | 2025-01-30 02:47:59 +0100 | |
---|---|---|
committer | 2025-01-30 02:47:59 +0100 | |
commit | a7bc1e7da4a456b6fa53a7f9f86a6f1f0a172029 (patch) | |
tree | df023be134235cfc84036a1ebda7f52561f2dae3 /widget | |
parent | ea8696eac2049fc19ea6ce5849922a002123ac37 (diff) | |
download | iced-a7bc1e7da4a456b6fa53a7f9f86a6f1f0a172029.tar.gz iced-a7bc1e7da4a456b6fa53a7f9f86a6f1f0a172029.tar.bz2 iced-a7bc1e7da4a456b6fa53a7f9f86a6f1f0a172029.zip |
Avoid capturing mouse press when `text_editor` is unfocused
Diffstat (limited to 'widget')
-rw-r--r-- | widget/src/text_editor.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/widget/src/text_editor.rs b/widget/src/text_editor.rs index a3470768..502b5de9 100644 --- a/widget/src/text_editor.rs +++ b/widget/src/text_editor.rs @@ -768,6 +768,10 @@ where } } + if !matches!(binding, Binding::Unfocus) { + shell.capture_event(); + } + apply_binding( binding, self.content, @@ -780,8 +784,6 @@ where if let Some(focus) = &mut state.focus { focus.updated_at = Instant::now(); } - - shell.capture_event(); } } } |