Skip to content
Merged
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## [`master`](https://github.com/elastic/eui/tree/master)

- Added `Enter` key press functionality to `EuiSuperDatePicker` ([#3048](https://github.com/elastic/eui/pull/3048))
- Exported `dateFormatAliases` as a part of the public API ([#3043](https://github.com/elastic/eui/pull/3043))
- Exported `EuiTextProps` type definition ([#3039](https://github.com/elastic/eui/pull/3039))
- Removed `role` attribute from `EuiImage`([#3036](https://github.com/elastic/eui/pull/3036))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ exports[`EuiSuperDatePicker is rendered 1`] = `
<EuiFlexGroup
className="euiSuperDatePicker__flexWrapper"
gutterSize="s"
onKeyPress={[Function]}
Comment thread
anishagg17 marked this conversation as resolved.
Outdated
responsive={false}
>
<EuiFlexItem>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,7 @@ export class EuiSuperDatePicker extends Component {
isCustom
startDateControl={<div />}
endDateControl={<div />}
onKeyPress={this.handleKeyPress}
readOnly>
<span className="euiSuperDatePicker__prettyFormat">
{prettyInterval(this.props.isPaused, this.props.refreshInterval)}
Expand Down Expand Up @@ -412,6 +413,12 @@ export class EuiSuperDatePicker extends Component {
}
};

handleKeyPress = event => {
if (event.key === 'Enter') {
this.handleClickUpdateButton();
Comment thread
chandlerprall marked this conversation as resolved.
Outdated
}
};

renderUpdateButton = () => {
if (!this.props.showUpdateButton || this.props.isAutoRefreshOnly) {
return;
Expand Down Expand Up @@ -461,6 +468,7 @@ export class EuiSuperDatePicker extends Component {
<EuiFlexGroup
gutterSize="s"
responsive={false}
onKeyPress={this.handleKeyPress}
Comment thread
anishagg17 marked this conversation as resolved.
Outdated
Comment thread
chandlerprall marked this conversation as resolved.
Outdated
className={flexWrapperClasses}>
<EuiFlexItem>
<EuiFormControlLayout
Expand Down