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

Tooltip does not disappear even if the widget is not visible anymore #4052

Closed
kraanzu opened this issue Jan 20, 2024 · 4 comments
Closed

Tooltip does not disappear even if the widget is not visible anymore #4052

kraanzu opened this issue Jan 20, 2024 · 4 comments
Labels
bug Something isn't working duplicate This issue or pull request already exists

Comments

@kraanzu
Copy link

kraanzu commented Jan 20, 2024

Have you checked closed issues? https://github.com/Textualize/textual/issues?q=is%3Aissue+is%3Aclosed

Yes

Please give a brief but clear explanation of the issue. If you can, include a complete working example that demonstrates the bug. Check it can run without modifications.

If the tooltip of a widget is set and then the widget is not visible anymore, the tooltip stays there until the mouse is moved

It will be helpful if you run the following command and paste the results:

textual diagnose

Textual Diagnostics

Versions

Name Value
Textual 0.47.1
Rich 13.7.0

Python

Name Value
Version 3.11.6
Implementation CPython
Compiler GCC 13.2.1 20230801
Executable /home/kraanzu/Documents/termtyper/venv/bin/python

Operating System

Name Value
System Linux
Release 6.6.2-arch1-1
Version #1 SMP PREEMPT_DYNAMIC Mon, 20 Nov 2023 23:18:21 +0000

Terminal

Name Value
Terminal Application WezTerm (20230712-072601-f4abf8fd)
TERM xterm-256color
COLORTERM truecolor
FORCE_COLOR Not set
NO_COLOR Not set

Rich Console options

Name Value
size width=144, height=34
legacy_windows False
min_width 1
max_width 144
is_terminal True
encoding utf-8
max_height 34
justify None
overflow None
no_wrap False
highlight None
markup None
height None

Feel free to add screenshots and / or videos. These can be very helpful!

from textual import on
from textual.app import App, ComposeResult
from textual.widgets import Button

TEXT = "I am a tooltip"


class TooltipApp(App):
    CSS = """
    Screen {
        align: center middle;
    }
    """

    def compose(self) -> ComposeResult:
        yield Button("Click me", id="button")

    def on_mount(self) -> None:
        self.query_one(Button).tooltip = TEXT

    @on(Button.Pressed)
    def test(self, event: Button.Pressed):
        event.button.styles.visibility = "hidden"


if __name__ == "__main__":
    app = TooltipApp()
    app.run()
Copy link

We found the following entries in the FAQ which you may find helpful:

Feel free to close this issue if you found an answer in the FAQ. Otherwise, please give us a little time to review.

This is an automated reply, generated by FAQtory

@TomJGooding
Copy link
Contributor

@kraanzu
Copy link
Author

kraanzu commented Jan 23, 2024

oops. My bad for opening a dup
I'll close this one :)

@kraanzu kraanzu closed this as completed Jan 23, 2024
Copy link

Don't forget to star the repository!

Follow @textualizeio for Textual updates.

@davep davep added bug Something isn't working duplicate This issue or pull request already exists labels Jan 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants