-
Notifications
You must be signed in to change notification settings - Fork 80
Filter: allow users to choose to match or ignore specific item properties #5063
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
Comments
I prefer having an allowList like Should this move to a breaking change release? Or do we want to go with a blockList instead? |
We could also consider the default to match all unless the user sets the allow list. This would preserve the existing behavior, allow users to ignore certain fields and doesn't require users to set anything by default. |
Sounds like a good plan |
…ies (#9541) **Related Issue:** #5063 ## Summary - add matchFields argument to filter utility - allows filtering fields at the first level of an object. - Nested object fields will not be filtered. - Could be enhanced to do so in the future by enhancing `matchFields` to be an object - add filter utility spec tests (thank you co-pilot) - add `matchFields` property to `filter` component - add e2e tests for filter
Installed and assigned for verification. |
🍡 Verified locally on |
Description
Right now
calcite-filter
matches every property of the item's object. It would be great if we could create a new property that specifies either properties to ignore or the properties to match. The property typeArray<string>
so it would need to be set in JavaScript. Something likeor
thoughts on this @jcfranco?
Acceptance Criteria
A new property that either matches or ignores specific properties of filter's item objects.
Relevant Info
No response
Which Component
calcite-filter
Example Use Case
I was putting together a pagination sample for someone and noticed inconsistent filter results:
https://codepen.io/benelan/pen/qBoxdwv
I realized it was because I was adding a hex string
color
property for the card's thumbnail, which was also being matched. It would have been great to be able to do something likeor
You can work around the constraint by passing a subset of the items' properties to
calcite-filter
and then matching the item back to the full dataset with anid
or something that does get provided to filter. But it seems like a useful option for people anyway, and relatively low effort on our end to remove certain properties before filtering.The text was updated successfully, but these errors were encountered: