[autocomplete] New API to control the highlighted option
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 99.1k
- Forks
- 32.5k
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 106
Description
- I have searched the issues of this repository and believe that this is not a duplicate.
Summary 💡
Typing into the auto-complete and pressing enter should select something, such as the suggested option. The suggested option to select should be highlighted.
Examples 🌈
For example type in Good into the playground and press enter, nothing gets selected.
Lets say I have a text matching score when searching for Good as following:
The Good, the Bad and the Ugly = 0.3
Goodfellas = 0.8
I would want Goodfellas to be highlighted and selected when enter is pressed.
Motivation 🔦
The current auto-complete logic makes suggesting an option difficult.
Passing in a highlightedValue/suggestedValue would make the above possible. Set the first value in the list to be highlighted if one is not provided.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Autocomplete playground linked in the issue and inspect the current autocomplete logic for how typing, highlighting, and Enter selection interact. The work is done when a suggested or explicitly controlled option can be highlighted and pressing Enter selects it, including the Goodfellas example.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100