-
Notifications
You must be signed in to change notification settings - Fork 401
Closed
Description
I am in the middle of building out a React component library for use at work, but have run into a slight issue with this Typeahead library, namely the lack of ability to specify which keys will trigger an autocomplete / add event on the input. Particularly, I need to support SPACE as one of the triggering keys.
After reading your CONTRIBUTING.md, specifically the subsection regarding the addition of props, I am unsure what would be preferable.
Possible solutions would be:
- Adding a container inside of my own internal component library for the component wrapping your
<Typeahead />component, leveraging theonInputChangeevent to check for space having been pressed and some manipulation of theselectedvalue, and so on. - Submitting a PR for the
inputContainer.js's_handleKeyDownmethod to simply includeSPACEfrom yourkeyDownconstants file. This, of course, would be a breaking change so I doubt this is desirable. - Add a new property to allow the end-user to pass in an array of key-codes that would be checked for in the aforementioned
_handleKeyDownmethod, overriding the existing behavior which would remain the default.
I am happy to put together a PR, including updating the demo and documentation but I also do not want to spend time working on a solution that is likely to be rejected.
Metadata
Metadata
Assignees
Labels
No labels