Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
With `spaceSelectsMatch` enabled, an error `Uncaught TypeError: Cannot read property '0' of undefined` is sometimes given when attempting to autocomplete with any of space, tab, or enter. The cause appears to be that with this option enabled, sometimes this code path intended to handle KeyboardEvents will be entered again after handling a KeyboardEvent with another type of event (CustomEvent); this then later causes this error as `this.current.filteredItems` is now `undefined`, as the original KeyboardEvent has already been handled. Checking whether the event looks like a KeyboardEvent, and returning early if it doesn't, appears to resolve this.
- Loading branch information