-
-
Notifications
You must be signed in to change notification settings - Fork 209
default filter as caseInsensitive ? #17
Comments
Indeed, that would be cool. You'd have to use |
me and PR = 2 ... |
@Sharlaan What? 😄 |
Maybe something like this ?
|
The filter needs to match every value if the input is empty so that the dropdown menu opens automatically on focus. The default filters of |
@Sharlaan Re-using |
Thanks but my current tests seem to show the filter property doesnot take any provided function:
... still gives caseSensistive behavior while should be insensitive. |
@Sharlaan I'm currently fixing that. 👍 |
Impressive answer speed 👍 |
This works now: <ChipInput
openOnFocus
filter={AutoComplete.fuzzyFilter}
dataSource={['alpha', 'beta']}
hintText="Try typing apha..." //sic!
/> |
Great job, default caseInsensitive works perfect ! but... filter={AutoComplete.fuzzyFilter} means user has to import { AutoComplete } from 'material-ui' on top of importing material-chip-input.... That's why i suggested the enum in Issue #18 . |
@Sharlaan I don't wand to add any filter to this component. Importing |
compared to:
|
Wow, that's one line in your code vs. more code I have to maintain. 👎 I'm still not convinced. What's so bad about importing stuff? Using libraries and re-using code is great! 😄 |
true it's more typing for you, i just meant AutoComplete reference should be purely internal. |
Oh, I see what you mean. You don't want to depend on It's much more flexible this way, as it allows to use any function and not just some fixed set of functions. |
Ok got it, sorry i didnot realize the "single interface for any filter function" pattern. |
default filter is set as caseSensistive in v0.4.1
Would not it be better as caseInsensitive by default ?
(would just have to add .toLowerCase() to the filter function)
The text was updated successfully, but these errors were encountered: