-
Notifications
You must be signed in to change notification settings - Fork 76
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
feat(filter): adds ability to match only specific filter data properties #9541
Conversation
@jcfranco do you want to review this one or is it good to go? |
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.
I have one concern regarding the change in list filtering behavior, but otherwise, this looks great, @driskull!
@@ -558,6 +558,7 @@ export class List | |||
aria-label={filterPlaceholder} | |||
disabled={disabled} | |||
items={dataForFilter} | |||
matchFields={["label", "description", "metadata"]} |
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.
I think this also needs to include value
. Otherwise, we're changing existing filtering behavior.
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.
I think we should consider this a bug. It was never intended to search by value. Value is more of a unique identifier and not content like label, description and metadata are.
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.
For filtering, we should only be searching content. I wouldn't consider value
to be content. I think we should not search it by default for anyone using a list with a filter.
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.
How about I move the list changes to a separate followup PR with the title fix(list): only filter by list item content
? @jcfranco
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.
I think we should consider this a bug. It was never intended to search by value. Value is more of a unique identifier and not content like label, description and metadata are.
I disagree with this. The filtering has always included value
props by default. Could we introduce a matchFields
prop to all filtering components, allowing users to omit value
if they prefer?
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.
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.
Gotcha. Will give this another look.
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.
🕵️🕵️🕵️🕵️🕵️🕵️🕵️🕵️🕵️🕵️🕵️🕵️🕵️🕵️🕵️🕵️🕵️🕵️🕵️🕵️🕵️🕵️🕵️🕵️
🕵️🔍🕵️🕵️🕵️🔍🔍🔍🔍🕵️🔍🔍🔍🔍🔍🕵️🔍🕵️🕵️🕵️🔍🕵️🔍🕵️
🕵️🔍🕵️🕵️🕵️🔍🕵️🕵️🕵️🕵️🕵️🕵️🔍🕵️🕵️🕵️🔍🔍🕵️🔍🔍🕵️🔍🕵️
🕵️🔍🕵️🕵️🕵️🔍🕵️🔍🔍🕵️🕵️🕵️🔍🕵️🕵️🕵️🔍🕵️🔍🕵️🔍🕵️🔍🕵️
🕵️🔍🕵️🕵️🕵️🔍🕵️🕵️🔍🕵️🕵️🕵️🔍🕵️🕵️🕵️🔍🕵️🕵️🕵️🔍🕵️🕵️🕵️
🕵️🔍🔍🔍🕵️🔍🔍🔍🔍🕵️🕵️🕵️🔍🕵️🕵️🕵️🔍🕵️🕵️🕵️🔍🕵️🔍🕵️
🕵️🕵️🕵️🕵️🕵️🕵️🕵️🕵️🕵️🕵️🕵️🕵️🕵️🕵️🕵️🕵️🕵️🕵️🕵️🕵️🕵️🕵️🕵️🕵️
Related Issue: #5063
Summary
matchFields
to be an objectfilterProps
property tofilter
component