-
Notifications
You must be signed in to change notification settings - Fork 370
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
Controls use different amount of space when hidden #2369
Comments
Thanks for the report! This certainly does not look intended. |
I had a short synchronization with the team on this and it turned out it is generally on purpose that hidden fields still consume space to avoid layout shifts: Usually, we use flex-box and create an item for each child, regardless of whether it is rendered or not. The children do not know what kind of layout they rendered in.
This was deliberately implemented like this at the time because there were use cases that required that layouts do not shift when controls are hidden or shown. We know that your case is also valid and there is no one size fits all solution. However, we do not intend to change the general behavior at this moment. Nevertheless, your screenshots show that the "hidden" items use less space than the visible ones. This causes layout shifts again once a hidden item becomes visible again. Thus, I'll rename the issue accordingly |
I can appreciate that intention. My understanding is that layouts can take options. Would having that as an option on vertical / horizontal layouts be a possible direction or would you expect needing completely custom renderers? Something like Edit: I guess an alternate api idea would be additional effect type like |
Yes every UI Schema element can have an In this case, the option should be named in a way that its default value is the current behavior. To make clear what it actually does it could be named @sdirix Do you see any concern that I overlooked with introducing this? IMO this could be a suitable solution to support both use cases. But maybe I missed something. |
Some thoughts:
I'm interested in suggestions weighing these (and other) points against each other so we can cover all needs in some way, either built-in or via straightforward customizations. |
Describe the bug
In a horizontal layout controls that are not shown still consume space unexpectedly.
Expected behavior
I expect only controls that are shown will participate in the flex layout and space is not associated with controls that are not shown.
Steps to reproduce the issue
Notice the unexpected reserved space after the connection status value that looks incorrect:
Notice that the spacing between the description and operator field is too large and looks incorrect:
The following are the schemas demonstrated. The issue appears on both the seeds I tested, the current angular seed and the current vue seed.
schema
uischema.json
Screenshots
See above
Which Version of JSON Forms are you using?
v3.3.0
Package
Angular Material Renderers
Additional context
No response
The text was updated successfully, but these errors were encountered: