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

Noninteractive tooltip with any content (on_hover_ui) #5519

Open
PPakalns opened this issue Dec 26, 2024 · 1 comment · May be fixed by #5543
Open

Noninteractive tooltip with any content (on_hover_ui) #5519

PPakalns opened this issue Dec 26, 2024 · 1 comment · May be fixed by #5543

Comments

@PPakalns
Copy link
Contributor

When hover (tooltip) contains interactive widgets then mouse pointer can interact with the content of the tooltip, tooltip doesn't close when mouse leaves the original item that was hovered.

This causes issue when tooltip is used as only preview and shouldn't be interactable.

To get old behavior back the following workaround can be used:

if response.hovered() {
    response.show_tooltip_ui(|ui| {
        //  ....
    });
}

But this doesn't function very well because there is no delay before raising the tooltip. There is no handling of time when the scroll area was last scrolled etc. These features that are missing in workaround makes tooltip not flicker as much.

Describe the solution you'd like
Add a second on_hover_ui method or flag that can be used with tooltip that has interactive content, but shouldn't be interactable (when mouse leaves original item, tooltip closes instead of allowing to interact with the content of the tooltip)

@PPakalns
Copy link
Contributor Author

Previous discussion:
#4793

@PPakalns PPakalns changed the title Noninteractive tooltip with interactive content (on_hover_ui) Noninteractive tooltip with any content (on_hover_ui) Dec 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant