-
Notifications
You must be signed in to change notification settings - Fork 788
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
Bug: Custom compound widget not being rendered inside TabPane #3010
Comments
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 |
As always, 2 minutes later I discover a solution. Using the |
If I remember correctly, you might need to set the height/width to something like auto on a custom widget inherited from |
Would you mind trying the workaround mentioned in #2411 and letting us know if it works for you? |
@davep that fix didn't seem to help. Setting to auto also didn't seem to have any effect |
I also tried switching to a grid, was having issues there as well so I just backed down to the example located at https://textual.textualize.io/guide/layout/#grid, and it looks nothing like the expected output. Including a better textual diagnose below Textual DiagnosticsVersions
Python
Operating System
Terminal
Rich Console options
|
@coffeegist Thanks. Now that I'm back at a keyboard I've done a quick test with your code. If you add this to your DEFAULT_CSS = """
SettingsWidget {
height: auto;
}
""" everything works fine. The issue is you're creating Setting it to |
Thanks for the reply and clarification @davep! |
Don't forget to star the repository! Follow @textualizeio for Textual updates. |
Most welcome. Glad it helped. |
When writing a recent application, I wanted to use the TabbedContent widget with TabPanes to keep things a little bit more clear for the user. I had already created a custom widget for what would be the TabPane content, so instead of yielding the custom widgets directly, I yielded them from within a TabPane context block. However, when doing this, the TabPane is blank. I then copied the contents of the
compose
method of my custom widget and pasted it inside the TabPane context block (where I previously yielded my custom widget) and everything works as expected.The text was updated successfully, but these errors were encountered: