Skip to content

Why onInputChange expects a value to be returned? #1760

Description

@roman01la

Hello!

I didn't expect that onInputChange handler would make use of return value to set a new inputValue in Select component. It happens here. Essentially it means that onInputChange is an interceptor rather than handler.

What's the motivation behind this behavior? Is it something that can be changed?

Thanks!

Activity

  1. cbergmiller commented on May 26, 2017

    @cbergmiller
    Contributor

    This allows you to manipulate input that is entered into the input field. See here.

    You can always return the unchanged new input value if you just want to get the updated value.
    Changing this behavior would break downwards compatibility of the API.

  2. roman01la commented on May 26, 2017

    @roman01la
    Author

    Thanks for response! I'd at least add a note somewhere to avoid confusion. onInputChange name is usually means a handler function.

  3. agirton commented on May 26, 2017

    @agirton
    Collaborator

    Hi @roman01la would you like to submit a PR to update the documentation? 😄

  4. agirton commented on Jul 1, 2017

    @agirton
    Collaborator

    Closing as the README has been updated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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