Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PopupMenuButton always display a tooltip even if none are defined #2867

Closed
azhago opened this issue Mar 13, 2024 · 3 comments · Fixed by #2882
Closed

PopupMenuButton always display a tooltip even if none are defined #2867

azhago opened this issue Mar 13, 2024 · 3 comments · Fixed by #2882
Assignees
Labels
bug Something isn't working enhancement Improvement/Optimization

Comments

@azhago
Copy link
Contributor

azhago commented Mar 13, 2024

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

@ndonkoHenri ndonkoHenri self-assigned this Mar 13, 2024
@azhago
Copy link
Contributor Author

azhago commented Mar 14, 2024

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)

@ndonkoHenri
Copy link
Collaborator

Will take a look.

@ndonkoHenri ndonkoHenri linked a pull request Mar 16, 2024 that will close this issue
@ndonkoHenri ndonkoHenri added bug Something isn't working enhancement Improvement/Optimization labels Mar 20, 2024
@ndonkoHenri
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement Improvement/Optimization
Projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

2 participants