Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(select-inputs): support inputValue #1121

Merged
merged 2 commits into from
Oct 22, 2019
Merged

feat(select-inputs): support inputValue #1121

merged 2 commits into from
Oct 22, 2019

Conversation

montezume
Copy link
Contributor

Allows you to do things like this

hhere
With code that looks like

  const [inputValue, setInputValue] = React.useState('');

  return (
    <SelectInput
      {...props}
      inputValue={inputValue}
      onInputChange={(value, { action }) => {
        if (action === 'input-change' || action === 'set-value') {
          setInputValue(value);
        }
      }}
    />
  );

@montezume montezume requested a review from jonnybel October 21, 2019 16:04
@montezume montezume added the 🚀 Type: New Feature Something new label Oct 21, 2019
@montezume montezume self-assigned this Oct 21, 2019
@montezume
Copy link
Contributor Author

Oh I should add for other selects

@tdeekens
Copy link
Contributor

...should it be documented?

@montezume
Copy link
Contributor Author

It's sort of already in the docs

This input is built on top of react-select v2. It supports mostly same properties as react-select. Behaviour for some props was changed, and support for others was dropped.

In case you need one of the currently excluded props, feel free to open a PR adding them.

@tdeekens
Copy link
Contributor

Oki doks. Should have checked. Thanks.

@montezume montezume merged commit 6281c25 into master Oct 22, 2019
@montezume montezume deleted the ml-select-change branch October 22, 2019 08:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants