-
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
Content Disappearing on with nested width: auto
widgets
#4017
Comments
If you take a look at the source code for This |
I see now, that works! :D |
Out of interest, why are you inheriting from Widget rather than Static? Obviously this code is just a MRE which is much appreciated, but it might be useful to understand the context. The documentation about creating custom widgets does suggest using |
Well, There's no particular reason but Plus, the other widgets provided by textual such as I hope that makes sense. Also, It's been quite a while since I started building with textual before the documentation was even released so I guess it is also a habit to inherit from |
Like Tom points out, it was the fact that None of the other widgets that inherit from Given that the issue of the disappearing content was solved by Tom's comment, I'll close this issue! |
Don't forget to star the repository! Follow @textualizeio for Textual updates. |
Yes
I'm not too sure what's happening here but I'm sharing it.
I'm trying to render a widget with CSS
width: auto
within a parent which also happens to havewidth: auto
but the content is not visible.I tried to make a reproducible snippet for this issue using the
Label
widget but interestingly found out that if I inherit classLabel
orStatic
for example, the content just loads fineIt 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!
If you change the inheritance from
Widget
toLabel
forMyWidget
, it'll work fine ❓Not sure if this is expected but it is confusing if that's the case
The text was updated successfully, but these errors were encountered: