Material-ui: [Autocomplete] Start after specific number of letters

Created on 6 Feb 2020  路  10Comments  路  Source: mui-org/material-ui

I suggest adding more option in filter options, one of them start filter after a specific number of letters

  • [x] I have searched the issues of this repository and believe that this is not a duplicate.

Summary 馃挕

add startAfter to filterOptions that accept int

Examples 馃寛

const filterOptions = createFilterOptions({
matchFrom: 'start',
stringify: option => option.title,
startAfter: 2
});

Motivation 馃敠

it will give us more control and I am thinking its not just me requesting this one

Autocomplete enhancement waiting for 馃憤

All 10 comments

What's the use case?

We need to open the AutoComplete menu/list of options after two key strokes and thought it made sense to come from filter. @oliviertassinari @minaairsupport

Sorry, we are not really interested in the developer's use case for this. What's the motivation from an end-user perspective?

The use case for our team for this same feature request would be to disable the filter until _x_ number of characters are typed by the end user...thus limiting the distraction of the combo box until the list is filtered by at least a certain number of characters.

@watkinshughes Ok, it sounds fair. I don't think that it should be the default behavior but I can understand why some Product Manager would want it. Given the small overhead of the feature, I think that we can include it. Feel free to work on a pull request :).

Nice, thank you! Will see if I can get some time set aside for working on a PR.

Can I work on this?

@netochaves Please, do :)

maybe add another noOptions message when startAfter provided? Something like `Type 1 more character to search'

@CyanoFresh We won't fix it in the library, but feel free to share your solution to the problem, it could help others.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

iamzhouyi picture iamzhouyi  路  3Comments

FranBran picture FranBran  路  3Comments

newoga picture newoga  路  3Comments

chris-hinds picture chris-hinds  路  3Comments

activatedgeek picture activatedgeek  路  3Comments