You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Originally posted by nitzan-shaked December 17, 2022
(first of all: I'm happy to attach screenshots, videos, minimal code to repro, etc. -- just not sure how this community works. Apologies in advance!)
It looks like the following misbehaves:
a Static with height: auto,
nested in a Vertical with height: auto,
itself nested in a Vertical with height: auto; max-height: 10
Specifically: set the context of the Static to something long (say 20 lines of text), which displays nicely and adds a scrollbar as expected. Then, set the content of the Static to "Hello" -- it works, but everything remains "too tall". A simple refresh (just resize the terminal a bit) solves this.
Given that a simple terminal resize "fixes" this I am assuming that's not intended behavior.
Specifically, changing the code of Widget._clear_arrangement_cache to:
def _clear_arrangement_cache(self) -> None:
"""Clear arrangement cache, forcing a new arrange operation."""
self._arrangement = None
# THE BELOW IS NEW
if isinstance(self._parent, Widget):
self._parent._clear_arrangement_cache()
Seems to solve, but honestly I'm not sure that's the right solution. If I'm anywhere in the right direction then there should be a "force_layout" method which will do this, and set ._layout_required, and probably do something with Screen (post a message? Set its layout_required? Donno.)
So, questions:
Am I missing the obvious? If so -- what is it?
And while I'm here -- are you interested in PR contribs? Eg fixing this; or -- stuff for TreeControl which I've added; or for DataTable.
If so -- how? Where's the guide you'd like me to follow? (tests, conventions, ci, ...)
Cheers!
The text was updated successfully, but these errors were encountered:
Discussed in #1384
Originally posted by nitzan-shaked December 17, 2022
(first of all: I'm happy to attach screenshots, videos, minimal code to repro, etc. -- just not sure how this community works. Apologies in advance!)
It looks like the following misbehaves:
a
Static
withheight: auto
,nested in a
Vertical
withheight: auto
,itself nested in a
Vertical
withheight: auto; max-height: 10
Specifically: set the context of the
Static
to something long (say 20 lines of text), which displays nicely and adds a scrollbar as expected. Then, set the content of theStatic
to "Hello" -- it works, but everything remains "too tall". A simple refresh (just resize the terminal a bit) solves this.Given that a simple terminal resize "fixes" this I am assuming that's not intended behavior.
Specifically, changing the code of
Widget._clear_arrangement_cache
to:Seems to solve, but honestly I'm not sure that's the right solution. If I'm anywhere in the right direction then there should be a "force_layout" method which will do this, and set
._layout_required
, and probably do something withScreen
(post a message? Set its layout_required? Donno.)So, questions:
Cheers!
The text was updated successfully, but these errors were encountered: