summaryrefslogtreecommitdiffstats
path: root/widget
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2025-01-30 02:47:59 +0100
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2025-01-30 02:47:59 +0100
commita7bc1e7da4a456b6fa53a7f9f86a6f1f0a172029 (patch)
treedf023be134235cfc84036a1ebda7f52561f2dae3 /widget
parentea8696eac2049fc19ea6ce5849922a002123ac37 (diff)
downloadiced-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.rs6
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();
}
}
}