From a7bc1e7da4a456b6fa53a7f9f86a6f1f0a172029 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Thu, 30 Jan 2025 02:47:59 +0100 Subject: Avoid capturing mouse press when `text_editor` is unfocused --- widget/src/text_editor.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'widget/src/text_editor.rs') 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(); } } } -- cgit