Code: Select all
frame { name = "context_menu", direction = "vertical", raise_hover_events = true,
flow {
button {caption="Option 1"},
button {caption="Option 2 long text"},
button {caption="Option 3" }
}
script.on_event(defines.events.on_gui_leave, function(e)
if element and e.element.name == "context_menu" then close(e) return end
end)
The event is already raised when you move over the content (the buttons) and do not leave the frame at all.
Expected behavior:
as long as the mouse is within the element, on_gui_leave must not be raised.
Using Factorio 2.0.41, but the problem has probably existed for some time.
P.S.:
the forum search does not work as expected.
- seach for "on_gui_leave" shows 10000 irrelevant results.
- seach for "on_gui_leave" in topics only shows less results but none of them with "on_gui_leave".