flet icon indicating copy to clipboard operation
flet copied to clipboard

PopupMenuButton always display a tooltip even if none are defined

Open azhago opened this issue 1 year ago • 2 comments

Hi,

PopupMenuButton control always display a tooltip, even when "" or None is passed

Can be reproduced with original exemple code :

import flet as ft

def main(page: ft.Page):
    def check_item_clicked(e):
        e.control.checked = not e.control.checked
        page.update()

    pb = ft.PopupMenuButton(
        items=[
            ft.PopupMenuItem(text="Item 1"),
            ft.PopupMenuItem(icon=ft.icons.POWER_INPUT, text="Check power"),
            ft.PopupMenuItem(
                content=ft.Row(
                    [
                        ft.Icon(ft.icons.HOURGLASS_TOP_OUTLINED),
                        ft.Text("Item with a custom content"),
                    ]
                ),
                on_click=lambda _: print("Button with a custom content clicked!"),
            ),
            ft.PopupMenuItem(),  # divider
            ft.PopupMenuItem(
                text="Checked item", checked=False, on_click=check_item_clicked
            ),
        ],
    )
    page.add(pb)

if __name__ == "__main__":
    ft.app(target=main)

Hover the buton always display a tooltip with "Show menu", even with a tooltip = None or tooltip = "" specified

image

azhago avatar Mar 13 '24 11:03 azhago

Hi, I also noticed that there is no delay at all with the tooltip display (it displays immediately) :not a bug, but not conform to other controls Other control tooltip have a delay (~1 - 2 seconds)

azhago avatar Mar 14 '24 22:03 azhago

Will take a look.

ndonkoHenri avatar Mar 15 '24 06:03 ndonkoHenri

A pre-release with the fix concerning this issue is now available. Try it and report if you face any further issues or have any questions:

pip install flet --pre

ndonkoHenri avatar Apr 01 '24 22:04 ndonkoHenri