-
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
Widget.loading
can cause widgets to disappear
#3935
Comments
For anyone who might stumble across this issue, you can workaround this by adding a min width/height to your widgets, for example: class LabelLoadingTestApp(App[None]):
CSS = """
Static, Label {
min-height: 1;
min-width: 9;
}
Button {
min-height: 3;
}
""" |
The loading indicator works with containers, but when applied to simple widgets it transforms them into containers that don't render because they have no dimensions. I don't think there is an easy fix for this one. We likely need some additional mechanism to change how a widget is rendered without changing its dimensions. Worth doing, but not a small job. Parking for now. |
After seeing #4958 and digging into this a bit in the past, I'm getting the feeling that more generally we need an approach to loading indicators that doesn't "turn a widget into a container" or interfere with a widget's children in any way. As an author of a container widget, I don't want to worry about suddenly receiving a new "child" widget of a totally unexpected type. |
I came to much the same conclusion. We need a mechanism that says render this widget in place of or on top of this other widget. |
Don't forget to star the repository! Follow @textualizeio for Textual updates. |
This might be a case of
Widget.loading
needing some more work, or the documentation for the property needing expanding, but right now using the widgetloading
property can have results that are counter what you'd expect given the documentation:This would suggest that a loading indicator would appear in a space the same dimension as the widget it's overlaying. With some widgets, that isn't the case. As a sample:
without loading, the screen looks like this:
when you toggle on loading, it looks like this:
The text was updated successfully, but these errors were encountered: