-
Notifications
You must be signed in to change notification settings - Fork 10
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: avoid breaking selects [DHIS2-16264] #1963
Conversation
🚀 Deployed on https://pr-1963--dhis2-import-export.netlify.app |
In that case we should add another Jira issue so we don't forget about it |
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.
LGTM, as I said, I think we should add another Jira issue so we know that the UX of the advanced options section can be improved
252586f
to
b2f0e02
Compare
## [1.5.66](v1.5.65...v1.5.66) (2023-12-15) ### Bug Fixes * avoid breaking selects [DHIS2-16264] ([#1963](#1963)) ([4300ef2](4300ef2))
🎉 This PR is included in version 1.5.66 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
* fix: loading logic * fix: hide stateful selects to preserve state * chore: format * chore: update snapshots
* fix: loading logic * fix: hide stateful selects to preserve state * chore: format * chore: update snapshots
* fix: loading logic * fix: hide stateful selects to preserve state * chore: format * chore: update snapshots
* fix: loading logic * fix: hide stateful selects to preserve state * chore: format * chore: update snapshots
https://dhis2.atlassian.net/browse/DHIS2-16264
The select components do a fetch on render for attributes to populate some options (the top two or three are hard-coded though). If you select an option that was populated by the fetch, that value is saved in the Final Form state. If you collapse the Advanced Options section, then re-expand the section, the select tries to choose the option based on that value, but the component needs to fetch again, so that option isn't available on first render
Edited:
I changed the
<MoreOptions>
component to keep children rendered to preserve state, and then hide them with CSSBefore:
before.mov
After:
after.mov