-
Notifications
You must be signed in to change notification settings - Fork 814
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
Pilot cannot click switch with horizontally aligned, long text #4144
Comments
Have you checked how your app looks at a smaller terminal size? The default size of the simulated app when running tests is 80x24, which I suspect is the issue. |
Sorry I also just spotted you're running Textual v0.44.1. There was recently a fix where calculating percentage dimensions previously didn't take into account padding/border, which might also explain some of the confusion about the sizing. You might want to update to version 0.48 or later. |
Oh, I can't believe I missed that, I forgot that poetry won't update pyproject.toml without explicit permission. Yeah, that seems to have fixed it. Thank you so much! |
Don't forget to star the repository! Follow @textualizeio for Textual updates. |
Hey! I was writing some tests for my textual app when I noticed some strange behavior that I can't seem to resolve. When I have some static text horizontally aligned with a switch, I cannot click the switch if the text is too long. Let me show a minimal example:
Here's the test file:
This current example will crash if you try to run it, as pilot will fail to click the switch resulting in an assertion error. However, the behavior gets even stranger. I've found that the maximum length that the static text can be is 28 characters, so
Preserve Profile URL Input V
in my example. However, if you remove the border style from the container, you get one extra character that you can have before the program will crash. Furthermore, if you remove the Markdown element from the compose function, it bumps up the character count to 37, and if you remove the border style with the Markdown gone, it behaves the same by only bumping it up to 38 available characters.The Switch is visible on the screen the entire time, so I really don't know that the issue is here. Also, if you remove the Horizontal, the issue goes away. Hopefully some of this will help you guys figure out what the issue is.
Textual Diagnostics
Versions
Python
Operating System
Terminal
Rich Console options
Additional diagnostics that it missed:
Terminal: Yakuake (Konsole)
Version: textual, version 0.44.1
The text was updated successfully, but these errors were encountered: