kristw commented on a change in pull request #6223: Fix time range filter
dropdown
URL:
https://github.com/apache/incubator-superset/pull/6223#discussion_r229409700
##########
File path:
superset/assets/src/explore/components/controls/DateFilterControl.jsx
##########
@@ -156,18 +163,24 @@ export default class DateFilterControl extends
React.Component {
this.setTypeCustomRange = this.setTypeCustomRange.bind(this);
this.setTypeCustomStartEnd = this.setTypeCustomStartEnd.bind(this);
this.toggleCalendar = this.toggleCalendar.bind(this);
+ this.changeTab = this.changeTab.bind(this);
}
- componentDidMount() {
+
+ componentWillMount() {
const value = this.props.value;
if (value.indexOf(SEPARATOR) >= 0) {
- this.state = { ...this.state, ...getStateFromSeparator(value) };
+ this.setState({ ...this.state, ...getStateFromSeparator(value) });
Review comment:
```
this.setState(getStateFromSeparator(value);
```
This will combine with existing state already. No need to combine with
`this.state` manually.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]