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

Tree with many nodes + Input + TabbedContent can lead to some nodes not being displayed #4805

Closed
armijnhemel opened this issue Jul 25, 2024 · 5 comments

Comments

@armijnhemel
Copy link

armijnhemel commented Jul 25, 2024

I am currently bumping into an issue where not all the nodes of a Tree are displayed. My program has an Input field at the top, then TabbedContent, with two TabPanes each containing a Tree. When I add 100 nodes to the trees only the first 98 are displayed. When I remove the TabbedContent, or the Input, then all nodes are displayed. I have absolutely no idea what I am doing wrong here.

I have tested this on Textual 0.70, 0.72 and 0.74. A simple test application is attached, as well as three screenshots.

example_bug_tree_tabbed_input.zip

Screenshot at 2024-07-25 19-08-09
Screenshot at 2024-07-25 19-07-45
Screenshot at 2024-07-25 19-07-27

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

@armijnhemel armijnhemel changed the title Tree with many branches + Input + TabbedContent can lead to some branches not being displayed Tree with many nodes + Input + TabbedContent can lead to some nodes not being displayed Jul 25, 2024
@TomJGooding
Copy link
Contributor

This simple method usually helps me debug layout issues:

TabbedContent {
  border: solid red;
}

This shows that the TabbedContent is overflowing its container. The default CSS for this widget has height: auto, so try changing this to 1fr in your CSS, or add a max-height.

@armijnhemel
Copy link
Author

Thank you! This definitely works. I am not sure if this is an actual bug I will leave closing the issue to you.

armijnhemel added a commit to armijnhemel/devicecode that referenced this issue Jul 25, 2024
@TomJGooding
Copy link
Contributor

Maybe TabbedContent could have a max-height by default? I do remember other issues/discussions where people have been caught out by this, but I'm conscious any change to the default CSS might break other layouts!

Just to clarify, the problem is where your TabbedContent is inside a Container. The Container has a default height of 1fr (and doesn't scroll). so it does make sense why your TabbedContent overflowed according to the current CSS.

I'll leave the decision to the Textual maintainers.

Copy link

Don't forget to star the repository!

Follow @textualizeio for Textual updates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants