-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Change the filtervalue to lowercase #14786
Conversation
I'm not super familiar with its implementation, but should this be incorporated into what |
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 should be treated in the function, not as a quickfix in the function's param. If we look at the getFilterMatcher
function this part appears to be the problem:
// If the term's name contains the filterValue, or it has children
// (i.e. some child matched at some point in the tree) then return it.
if ( -1 !== term.name.toLowerCase().indexOf( filterValue ) || term.children.length > 0 ) {
return term;
}
this condition lowercases the term but allows the filterValue to remain as is. I think it should be::
// If the term's name contains the filterValue, or it has children
// (i.e. some child matched at some point in the tree) then return it.
if ( -1 !== term.name.toLowerCase().indexOf( filterValue.toLowerCase() ) || term.children.length > 0 ) {
return term;
}
Does this sound right? @Jackie6 @youknowriad
155d8c4
to
981e0b4
Compare
Hi @draganescu thanks for your review. I think you are right. It is better to put |
packages/editor/src/components/post-taxonomies/hierarchical-term-selector.js
Outdated
Show resolved
Hide resolved
Co-Authored-By: Jackie6 <541172791@qq.com>
Description
Fix #13250
How has this been tested?
Types of changes
Change the filterValue to lower case
Checklist: