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

Tooltips should be removed on widget unmount and scrolling #3045

Closed
darrenburns opened this issue Aug 1, 2023 · 6 comments · Fixed by #4191
Closed

Tooltips should be removed on widget unmount and scrolling #3045

darrenburns opened this issue Aug 1, 2023 · 6 comments · Fixed by #4191
Assignees
Labels
bug Something isn't working Task

Comments

@darrenburns
Copy link
Member

darrenburns commented Aug 1, 2023

When a tooltip is visible on screen, and the widget it's associated with gets unmounted. The tooltip remains on screen, which looks kind of weird.

Also, if a tooltip is visible, and you scroll such that the widget is no longer on screen, the tooltip remains. When you finally move the cursor, it disappears.

When the parent is unmounted, or when we scroll, I believe the tooltips should be hidden immediately.

@davep
Copy link
Contributor

davep commented Feb 20, 2024

Also, if a tooltip is visible, and you scroll such that the widget is no longer on screen, the tooltip disappears. When you finally move the cursor, it disappears.

Just to check: there's a typo here @darrenburns? This is trying to say that if you scroll the tooltip remains, or something else?

@darrenburns
Copy link
Member Author

It remains, yeah

davep added a commit to davep/textual-sandbox that referenced this issue Feb 20, 2024
@davep
Copy link
Contributor

davep commented Feb 20, 2024

Another situation: if a widget is visible, has a tooltip shown, and then it is made not visible.

@davep
Copy link
Contributor

davep commented Feb 20, 2024

And another situation: if a widget is display: block, has a tooltip shown, and then becomes display: none.

@davep davep linked a pull request Feb 20, 2024 that will close this issue
@davep
Copy link
Contributor

davep commented Feb 20, 2024

#4191 is working well and seems to cover all the bases. We've decided that we should open it up a little and make this based off a signal, which will be published when a layout change happens, and so they the tooltip system can subscribe to it (the idea being someone's third party tooltip system could do the same).

Also, in addition to this: tooltips don't go away if a screen is pushed on top of a screen that is currently displaying a tooltip, so we'll look at taking that into account too.

Copy link

Don't forget to star the repository!

Follow @textualizeio for Textual updates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Task
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants