Skip to content

Configurable "Complete Hint" Key Configuration #330

@67726e

Description

@67726e

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:

  1. Adding a container inside of my own internal component library for the component wrapping your <Typeahead /> component, leveraging the onInputChange event to check for space having been pressed and some manipulation of the selected value, and so on.
  2. Submitting a PR for the inputContainer.js's _handleKeyDown method to simply include SPACE from your keyDown constants file. This, of course, would be a breaking change so I doubt this is desirable.
  3. 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 _handleKeyDown method, 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

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions