fix: selection on mbtn_up requires mbtn_down first (#348)

Without checking if mbtn_down happened first in the menu, it is possible
to select an item right after opening the menu from the controls.
(mbtn_down on control opens menu, mbtn_up selects item in menu)
This commit is contained in:
christoph-heinrich
2022-10-28 09:46:21 +02:00
committed by GitHub
parent b5ca97adcf
commit 00d249a351

View File

@@ -498,7 +498,7 @@ function Menu:fling_distance()
end
function Menu:on_global_mbtn_left_up()
if self.proximity_raw == 0 and not self.is_dragging then
if self.proximity_raw == 0 and self.drag_data and not self.is_dragging then
self:select_item_below_cursor()
self:open_selected_item({preselect_submenu_item = false})
end