-
Notifications
You must be signed in to change notification settings - Fork 3.4k
feat(autocomplete): allow select on match to be case insensitive. #6935
feat(autocomplete): allow select on match to be case insensitive. #6935
Conversation
265fb7d
to
e2587f7
Compare
if (searchText == displayValue) select(0); | ||
var isMatching = searchText == displayValue; | ||
if ($scope.matchInsensitive && !isMatching) { | ||
isMatching = searchText.toLowerCase() == displayValue.toLowerCase(); |
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.
Not using a ternary operator here, because it will be really unclear.
isMatching == false
is just saving up an unnecessary step.
placeholder: '@placeholder', | ||
noCache: '=?mdNoCache', | ||
selectOnMatch: '=?mdSelectOnMatch', | ||
matchInsensitive: '=?mdMatchCaseInsensitive', |
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.
Let's invert the logic here. Better name is matchCase
which should have default value == false
.
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.
@ThomasBurleson If understood everything right ->
- By default it will ignore case
- Allows caring about case when using
md-match-case="true"
Updated it to behave as this. See specs for example.
3476db5
to
659a4e6
Compare
9607e4e
to
a9286de
Compare
@ThomasBurleson is that by intention, that you merged the old version? without the change |
Would be great if you give a small statement to this 👍 |
CodePen? I can't get this too work. |
@gigablox Just apply the new attribute |
Fixes #5782