palantir/blueprint

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

Open

#4353 aperta il 30 set 2020

Vedi su GitHub
 (2 commenti) (0 reazioni) (0 assegnatari)TypeScript (2167 fork)batch import
P3Type: bughelp wanted

Metriche repository

Star
 (20.263 star)
Metriche merge PR
 (Merge medio 43g 10h) (27 PR mergiate in 30 g)

Descrizione

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.

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...

Guida contributor