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
Fix: form visibility #507
Fix: form visibility #507
Conversation
Any reason why this uses |
Futurewise,
I tried to look for something better, but can try harder. |
Found a pure CSS approach for spacing. Added custom data attr Also added the needed functionality to horizontal (inline) part. |
40a9003
to
eec3f1b
Compare
Screen.Recording.2021-01-20.at.11.36.21.AM.movNeeds discussion: @lo5 this approach will not work for cases when
|
Rebased against current master. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR causes a breaking change: the visible
attribute has been removed from the API.
TBH I don't remember the reasoning why |
aea0c29
to
6aaecd6
Compare
|
Rebased. |
@mturoci seeing similar behavior for Toggles, would that be handled automatically in this PR too or should I open a separate issue? Wave 0.16.0 from h2o_wave import site, ui
page = site['/']
page['toggle'] = ui.form_card(
box='4 4 4 4',
items=[
ui.toggle(name='hidden', label='You can\'t see me', visible=False),
ui.toggle(name='shown', label='You can see me', visible=True),
]
)
page.save() |
@mtanco This PR fixes visibility for all the form items at once so no need to open a new issue. |
@mturoci - what would be the minimal fix for this bug (without changes to the generator, or introducing changes to launch.json, precommit.js, etc.)? |
The minimal changes are moving visibility handling logic from component scope to form scope. The generator is updated so that every form component has a consistent |
444edef
to
1ba9103
Compare
@lo5 rebased against current master, removed all the extra stuff that is not necessarily part of the fix, removed the generator tweaks and settled back to specifying |
@mturoci What is the status of this issue? Will it be fixed soon? Thanks! |
Moved the visibility handling logic to parent form component instead of dealing with it at component level.
There was also a minor spacing issue - we applied
marginTop: 0
to:not(:first-child)
selector. The problem is, this selector looks at the DOM (hidden elements are still present in the DOM), not whether the element is visible or not. I managed to fix it via CSS.Closes #484
Closes #817