From fac1d98b9017d9c3a78653891ae0f309a0851569 Mon Sep 17 00:00:00 2001 From: tomasklaen Date: Tue, 3 Sep 2024 21:11:58 +0200 Subject: [PATCH] fix: don't activate items in non-callback mode menus when modifiers or actions are used --- src/uosc/lib/menus.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/uosc/lib/menus.lua b/src/uosc/lib/menus.lua index a202b222..2cad37c2 100644 --- a/src/uosc/lib/menus.lua +++ b/src/uosc/lib/menus.lua @@ -19,7 +19,10 @@ function open_command_menu(data, opts) ---@diagnostic disable-next-line: deprecated mp.commandv(unpack(itable_join({'script-message-to'}, menu.root.callback, {utils.format_json(event)}))) elseif event.type == 'activate' then - run_command(event.value) + -- Modifiers and actions are not available on basic non-callback mode menus + if not event.modifiers and not event.action then + run_command(event.value) + end -- Convention: Only pure item activations should close the menu. -- Using modifiers or triggering item actions should not. if not event.keep_open and not event.modifiers and not event.action then