-
Notifications
You must be signed in to change notification settings - Fork 26
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: combo box visibility bug #2816
Conversation
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.
Thanks @jfmcquade - I had wondered originally whether the combo_box was just set-up to hide when data not available but makes more sense that it's a reactivity issue. Definitely happy to have the code refactored to use signal patterns, looks good to me
Visit the preview URL for this PR (updated for commit 107aa1c): https://plh-teens-app1--pr2816-fix-combo-box-zeiskvms.web.app (expires Thu, 13 Mar 2025 17:16:39 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: e4c0bab6b08dd290fbf002fd6e07987fa4b5fce1 |
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.
Functional test passed on debug
and plh_kids_kw
deployments.
PR Checklist
Description
Fixes a bug where the combo box component would not always be visible on initial render of parent template.
Testing
As well as testing on the
plh_kids_kw
templates referenced in the issue, it would be good to have a quick check of comp_combo_box debug template to ensure all the functionality is still working as expected. I have checked myself and haven't found any issues.Dev notes
The bug was due to issues with reactivity and change detection on some level – likely the value of the
variant
property as read in the html template not updating reliably (ifvariant
is undefined, the component would not render any content). This is fixed by refactoring the component to make all param values reactively read from aparams()
signal (in line with recent updates to other components, e.g. button). Further improvements could probably be made to the component's logic, but as the handling of themodal
variant is quite complex, via thecombo-box-modal
sub-component, I'm wary of changing it unnecessarily.Git Issues
Closes ParentingForLifelongHealth/plh-kids-app-kw-content#152
Screenshots/Videos
Testing the template referenced in the issue,
article_oneononetime_explore_5
on theplh_kids_kw
deployment, all the combo boxes now consistently render, whereas before there was almost always an issue with at least one when loading the page.