Skip to content
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

Merged
merged 4 commits into from
Feb 27, 2025
Merged

fix: combo box visibility bug #2816

merged 4 commits into from
Feb 27, 2025

Conversation

jfmcquade
Copy link
Collaborator

@jfmcquade jfmcquade commented Feb 25, 2025

PR Checklist

  • PR title descriptive (can be used in release notes)

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 (if variant is undefined, the component would not render any content). This is fixed by refactoring the component to make all param values reactively read from a params() 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 the modal variant is quite complex, via the combo-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 the plh_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.

Screenshot 2025-02-25 at 12 08 43

Copy link
Member

@chrismclarke chrismclarke left a 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

@esmeetewinkel esmeetewinkel added the test - preview Create a preview deployment of the PR label Feb 27, 2025
Copy link

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

Copy link
Collaborator

@esmeetewinkel esmeetewinkel left a 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.

@esmeetewinkel esmeetewinkel merged commit 777af75 into master Feb 27, 2025
8 checks passed
@esmeetewinkel esmeetewinkel deleted the fix/combo-box branch February 27, 2025 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix test - preview Create a preview deployment of the PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Combo box erratic behaviour
3 participants