-
Notifications
You must be signed in to change notification settings - Fork 815
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
Button rendering fails with non-standard text alignment #3570
Comments
I can't seem to reproduce that, with virtually the same setup. There's a missing import in button_bug.txt. Is there a missing dependancy? |
Ah, I can't reproduce it on main. But I can on v0.40.0. Curious. |
The missing import is indeed a bug in my code, but removing the line essentially changes nothing, since the |
Don't forget to star the repository! Follow @textualizeio for Textual updates. |
I'd appreciate it if you could verify that the file zipped in newbutt.zip still (despite the removal of text-align from the styles!) mangles the appearance of the buttons. The program is standalone other than Textual modules. This makes me suspect perhaps #3571 didn't fix the issue I was seeing. This is on 0.41.0. Textual DiagnosticsVersions
Python
Operating System
Terminal
Rich Console options
|
@holdenweb As I look at this, it seems to me this is the MRE of the problem you're seeing: from textual.app import App, ComposeResult
from textual.widgets import Button
class ButtonIssue(App[None]):
CSS = """
Button {
outline: white;
}
"""
def compose(self) -> ComposeResult:
yield Button("Test")
if __name__ == "__main__":
ButtonIssue().run() That is: the issue is the use of outline. |
Yes, that nails it. |
Given this wandered around a wee bit, and might actually have hit on two different issues, I'll raise a fresh one with the above. |
Have you checked closed issues? https://github.com/Textualize/textual/issues?q=is%3Aissue+is%3Aclosed
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.
text-align: left;
and they render incorrectly, with misalignment of the right-hand borders, and hovering or clicking makes things worse. Removing the styling, so the button text is centred by default, removes the rendering error.text-align: left;
:Buggy program (as .txt to allow uploading): button_bug.txt
It will be helpful if you run the following command and paste the results:
Textual Diagnostics
Versions
Python
Operating System
Terminal
Rich Console options
Feel free to add screenshots and / or videos. These can be very helpful!
The text was updated successfully, but these errors were encountered: