diff --git a/src/app/script/dialog_class.cpp b/src/app/script/dialog_class.cpp index 6434da959..6426aa531 100644 --- a/src/app/script/dialog_class.cpp +++ b/src/app/script/dialog_class.cpp @@ -396,7 +396,8 @@ int Dialog_button_base(lua_State* L, T** outputWidget = nullptr) Dialog_connect_signal( L, 1, widget->Click, [dlg, widget](lua_State* L, Event&){ - dlg->lastButton = widget; + if (widget->type() == ui::kButtonWidget) + dlg->lastButton = widget; }); closeWindowByDefault = false; }