-
Notifications
You must be signed in to change notification settings - Fork 599
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: unable to set initial boolean attributes on picker #6311
Comments
@radium-v I believe we made a general decision that all boolean attributes should be setup to be |
@scomea can you take a look at reworking picker to support defaulting to |
Unfortunately |
# Pull Request ## 📖 Description As described in #6311 picker's "filter-selected" and "filter-query" attributes were incorrectly configured and always ended up being true unless set via the prop. This change resolves this issue by: - remove "filter-query" and "filter-selected" attributes (never worked) - introduces new `disableQueryFilter` and `disableSelectionFilter` props and associated attributes, defaults to false to match current default behavior - deprecates the `filterQuery` and `filterSelected` props but keeps them in sync with the new props so we shouldn't break anyone who is setting these This change also fixes an issue where the "no options available" display wasn't always showing up: ![image](https://github.com/microsoft/fast/assets/7649425/0702e75d-893a-494f-8723-d0ed1095582f) When initialized with no options picker could open the menu without displaying the "no options available" message. This pr simplifies the mechanism that shows that to ensure it shows up when needed. ### 🎫 Issues closes #6311 ## ✅ Checklist ### General - [x] I have included a change request file using `$ yarn change` - [ ] I have added tests for my changes. - [x] I have tested my changes. - [ ] I have updated the project documentation to reflect my changes. - [x] I have read the [CONTRIBUTING](https://github.com/microsoft/fast/blob/master/CONTRIBUTING.md) documentation and followed the [standards](/docs/community/code-of-conduct/#our-standards) for this project. ### Component-specific - [ ] I have added a new component - [x] I have modified an existing component - [ ] I have updated the [definition file](https://github.com/microsoft/fast/blob/master/packages/web-components/fast-components/CONTRIBUTING.md#definition) - [ ] I have updated the [configuration file](https://github.com/microsoft/fast/blob/master/packages/web-components/fast-components/CONTRIBUTING.md#configuration)
🐛 Bug Report
The
filter-selected
andfilter-query
boolean attributes on the<fast-picker>
aretrue
by default and the picker cannot be initialized in a state where they are not present.💻 Repro or Code Sample
In this example, the picker is created and by default has the
filter-selected
andfilter-query
attributes present:Inserting a
<fast-picker>
element in HTML has the same effect:In this example, the picker is created and does not have the attributes present when appended to the document body:
🤔 Expected Behavior
The attributes
filter-selected
andfilter-query
should not be present when not explicitly set.😯 Current Behavior
Since both
filterSelected
andfilterQuery
are bothtrue
at construction time, their boolean attributes are mapped to be present. There's no way to declare a<fast-picker>
element without these attributes - property mutation after assignment and before connection is required.💁 Possible Solution
Here are some possible solutions:
booleanConverter
converter to allow string values oftrue
andfalse
. This would break the defined API.filterSelected
andfilterQuery
tofalse
by default. This would break existing implementations which don't already set these attributes in an explicit manner.🔦 Context
This bug was found while converting the Karma tests to Playwright.
The text was updated successfully, but these errors were encountered: