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

Call props.onChange only when closing filter #4003

Merged
merged 1 commit into from
Dec 5, 2017

Conversation

betodealmeida
Copy link
Member

The DateFilterControl component calls props.onChange on its onChange, propagating instantly the values selected before "Ok" is clicked. This PR moves the call to props.OnChange to the close function, so that the new values are propagated only when "Ok" is clicked.

Screencast:

out

Unit test and lint ran fine:

$ cd superset/assets/javascripts
$ npm i
$ npm run test
...
409 passing (3s)
$ npm run lint
<no messages>

This PR fixes #3868.

@mistercrunch
Copy link
Member

LGTM

@mistercrunch mistercrunch merged commit 823f306 into apache:master Dec 5, 2017
@graceguo-supercat
Copy link

graceguo-supercat commented Dec 5, 2017

@betodealmeida Your code change has a problem: this.onChange is undefined but still in use. Though there is no exception thrown, because this.onChange is used as callback for setState, it's not a good practice to call undefined function.

@mistercrunch
Copy link
Member

thanks @graceguo-supercat we're pushing a fix through

@betodealmeida
Copy link
Member Author

I'll fix with a new PR, removing the callbacks.

michellethomas pushed a commit to michellethomas/panoramix that referenced this pull request May 24, 2018
wenchma pushed a commit to wenchma/incubator-superset that referenced this pull request Nov 16, 2018
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.21.0 labels Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.21.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[DatePicker] onChange is triggered too quick
3 participants