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:

committed by
GitHub

parent
b5ca97adcf
commit
00d249a351
@@ -498,7 +498,7 @@ function Menu:fling_distance()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function Menu:on_global_mbtn_left_up()
|
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:select_item_below_cursor()
|
||||||
self:open_selected_item({preselect_submenu_item = false})
|
self:open_selected_item({preselect_submenu_item = false})
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user