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

[TimezonePicker] 'inputProps' does not override search behavior. #4353

Open
arsenush opened this issue Sep 30, 2020 · 2 comments
Open

[TimezonePicker] 'inputProps' does not override search behavior. #4353

arsenush opened this issue Sep 30, 2020 · 2 comments

Comments

@arsenush
Copy link

Steps to reproduce

        <TimezonePicker
          ...
          inputProps={{
            value: this.searchQuery,
            onChange: this.handlerWhichShouldBeCalledButItIsnt
          }}
        >

Actual behavior

Callback for search input change is not called.

Expected behavior

According to docs callback for search input change should override Select's behavior and should be called.

Screenshot 2020-10-01 at 00 13 34

Possible solution

The onQueryChange prop which you pass to Select in timezonePicker.tsx is just:

private handleQueryChange = (query: string) => this.setState({ query });

No mentions about inputProps.onChange.

And as I understand in Select onQueryChange has some priority over inputProps.onChange.
Thus my callback which I pass to TimezonePicker is not called.

But it's just an assumption.

Please let me know if I do something wrong...

@adidahiya
Copy link
Contributor

Yeah, it looks like this API is unsupported despite what the docs say there. I would welcome a PR to add this feature.

Can you share a bit more about your use case and why you're trying to use a custom input change callback?

@arsenush
Copy link
Author

arsenush commented Oct 2, 2020

I am showing a custom right icon in the input when the search query is present (and hide it when it's empty).

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