mirror of
https://github.com/apache/superset.git
synced 2026-04-21 09:04:38 +00:00
Fix click on now in DateFilterControl (#4265)
When clicking on `now` or the infinity sign, the popover closes but the value doesn't show in the label as expected.
This commit is contained in:
committed by
GitHub
parent
b90c410c01
commit
9cf16a4ff2
@@ -69,9 +69,8 @@ export default class DateFilterControl extends React.Component {
|
||||
setType(type) {
|
||||
this.setState({ type });
|
||||
}
|
||||
setValue(val) {
|
||||
this.setState({ type: 'free', free: val });
|
||||
this.close();
|
||||
setValueAndClose(val) {
|
||||
this.setState({ type: 'free', free: val }, this.close);
|
||||
}
|
||||
setDatetime(dttm) {
|
||||
this.setState({ dttm: dttm.format().substring(0, 19) });
|
||||
@@ -175,13 +174,15 @@ export default class DateFilterControl extends React.Component {
|
||||
>
|
||||
<Button
|
||||
bsSize="small"
|
||||
onClick={this.setValue.bind(this, 'now')}
|
||||
className="now"
|
||||
onClick={this.setValueAndClose.bind(this, 'now')}
|
||||
>
|
||||
now
|
||||
</Button>
|
||||
<Button
|
||||
bsSize="small"
|
||||
onClick={this.setValue.bind(this, '')}
|
||||
className="clear"
|
||||
onClick={this.setValueAndClose.bind(this, '')}
|
||||
>
|
||||
clear
|
||||
</Button>
|
||||
|
||||
Reference in New Issue
Block a user