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

[select] fix: force Select to respect query prop #4363

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

cemreyavuz
Copy link
Contributor

Fixes #4362

Checklist

  • Includes tests
  • Update documentation

Changes proposed in this pull request:

As mentioned in the documentation of Select component, query prop can be used to control the InputGroup in Select component:

inputProps
Props to spread to the query InputGroup. Use query and onQueryChange instead of inputProps.value and inputProps.onChange to control this input.

However, as the code sandbox I provided in #4362, query prop acts like an initial value to it and doesn't control the InputGroup. This is because the one that controls the InputGroup is actually QueryList component. It initializes its internal state with the query prop that is passed to Select component. However, from that point onward, it keeps its internal query state and passes that internal state to the InputGroup.

What I have changed is that no matter what the internal query state of QueryList, the query prop of Select component is passed to the InputGroup if it is provided.

@adidahiya
Copy link
Contributor

Discussion in #4362

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

Successfully merging this pull request may close these issues.

[select] Select component doesn't respect the query prop
2 participants