-
Notifications
You must be signed in to change notification settings - Fork 41
Open
Description
Users of autocomplete systems have come to expect the following:
- Hitting ESC should close the autocomplete.
- Hitting TAB should select the first item if nothing is active. Hitting TAB if an item is active should do nothing.
It's easy to add this behavior outside the library, but the AlphaNum Conditions are too aggressive. We should add these Conditions to prevent re-renders for those keys. Here's my code to workaround the issue:
// autocomplete-js is very aggressive about handling keys. Even keys like
// TAB and ESC cause a re-render, which conflicts with our handling of those
// keys. Let's reach in there and turn off those keys.
const conditions = this.autocomplete.KeyboardMappings.AlphaNum.Conditions;
conditions.push({ Is: 9, Not: true });
conditions.push({ Is: 27, Not: true });
adaniello, Dahkon and ferthus
Metadata
Metadata
Assignees
Labels
No labels