open menu when mouseenter on button #3091
-
Hi, for group in menu_data.groups:
with ui.button(text=group.group_display_name) as group_button:
with ui.menu().props("anchor='top end'") as group_menu:
for submenu in group.submenus: this is small snippet of how the list of buttons and menus is generated. |
Beta Was this translation helpful? Give feedback.
Answered by
falkoschindler
May 17, 2024
Replies: 1 comment 3 replies
-
Hi @TeeFiX42, Do you mean something like this? with ui.button('Button').on('mouseenter', lambda: group_menu.open()):
with ui.menu().props("anchor='top end'") as group_menu:
ui.menu_item('Item') |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
That's a common problem with Python's "late binding":
https://github.com/zauberzeug/nicegui/wiki/FAQs#why-is-the-last-element-of-my-for-loop-used-in-every-step