-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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(VDataTable): include rows that exclusively match custom filters #11181
Conversation
Hey @Ignigena, TravisBuddy Request Identifier: 6a9e7350-898b-11ea-aae4-d3259c3e8c73 |
23145c3
to
b33e82a
Compare
|
||
return filtered | ||
return items.filter(item => | ||
(headersWithCustomFilters.length && headersWithCustomFilters.every(filterFn(item, search, defaultFilter))) || |
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.
this should be broken up so it's easier to understand, possibly with some comments
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 broke up the callback a bit and added some comments so it's a bit easier to parse the flow of logic. Let me know if this is what you were going for or if you'd like something else 🙂
Requesting Final comments from @vuetifyjs/contributors @vuetifyjs/core-team |
Description
Currently, if a custom filter is used on a header config, it won't evaluate on any
search
term that exclusively match this custom filter. The term must match one or more columns that fall underheadersWithoutCustomFilters
.Closes #9887
Motivation and Context
Behaviour is inconsistent since the custom filter will be evaluated up until the point that a search term is entered. Once a term is entered, even if the term matches the custom filter, the row is excluded from the results if none of the other columns match.
A simple example is provided in the Codepen in the linked issue: by adding a custom filter with a case-sensitive search for Dessert Name, the ability to search is lost.
How Has This Been Tested?
Markup:
Types of changes
Checklist:
master
for bug fixes and documentation updates,dev
for new features and backwards compatible changes andnext
for non-backwards compatible changes).