mirror of
https://github.com/helix-editor/helix.git
synced 2024-11-22 09:26:19 +04:00
Consume all mouse events inside popups
Fixes issues of mouse clicks "bleeding" through into the editor when clicked on top of popups. In previous versions, mouse events were ignored and passed into the lower layers which resulted in editor cursor being moved when popup areas are clicked.
This commit is contained in:
parent
d05cc25794
commit
a97bf79cf7
@ -204,14 +204,16 @@ fn handle_mouse_event(
|
||||
match kind {
|
||||
MouseEventKind::ScrollDown if self.has_scrollbar => {
|
||||
self.scroll_half_page_down();
|
||||
EventResult::Consumed(None)
|
||||
}
|
||||
MouseEventKind::ScrollUp if self.has_scrollbar => {
|
||||
self.scroll_half_page_up();
|
||||
EventResult::Consumed(None)
|
||||
}
|
||||
_ => EventResult::Ignored(None),
|
||||
}
|
||||
_ => {}
|
||||
};
|
||||
|
||||
// Mouse event happened within the popup; consume the event so that
|
||||
// it doesn't bleed into the editor.
|
||||
EventResult::Consumed(None)
|
||||
}
|
||||
|
||||
fn close_cb(&self) -> Callback {
|
||||
|
Loading…
Reference in New Issue
Block a user