diff --git a/helix-term/src/ui/menu.rs b/helix-term/src/ui/menu.rs index 8bc6a0cf..99e8ee44 100644 --- a/helix-term/src/ui/menu.rs +++ b/helix-term/src/ui/menu.rs @@ -235,6 +235,9 @@ impl Component for Menu { fn handle_event(&mut self, event: &Event, cx: &mut Context) -> EventResult { let event = match event { Event::Key(event) => *event, + // Menu is a modal and should consume mouse events so clicks don't fall + // through to the editor underneath + Event::Mouse(_) => return EventResult::Consumed(None), _ => return EventResult::Ignored(None), }; diff --git a/helix-term/src/ui/picker.rs b/helix-term/src/ui/picker.rs index c61321f6..519a6003 100644 --- a/helix-term/src/ui/picker.rs +++ b/helix-term/src/ui/picker.rs @@ -1058,6 +1058,9 @@ impl Component for Picker *event, Event::Paste(..) => return self.prompt_handle_event(event, ctx), Event::Resize(..) => return EventResult::Consumed(None), + // Picker is a modal and should consume mouse events so clicks don't fall + // through to the editor underneath + Event::Mouse(_) => return EventResult::Consumed(None), _ => return EventResult::Ignored(None), }; diff --git a/helix-term/src/ui/prompt.rs b/helix-term/src/ui/prompt.rs index 04b785fe..c291a329 100644 --- a/helix-term/src/ui/prompt.rs +++ b/helix-term/src/ui/prompt.rs @@ -612,6 +612,9 @@ impl Component for Prompt { } Event::Key(event) => *event, Event::Resize(..) => return EventResult::Consumed(None), + // Prompt is a modal and should consume mouse events so clicks don't fall + // through to the editor underneath + Event::Mouse(_) => return EventResult::Consumed(None), _ => return EventResult::Ignored(None), };