Skip to content

Commit

Permalink
fix: replace onKeyPress with onKeyDown
Browse files Browse the repository at this point in the history
  • Loading branch information
alaa-yahia committed Aug 19, 2024
1 parent 2623729 commit 1ff177d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class FromDateFilterPlain extends Component<Props> {
this.props.onBlur(FromDateFilterPlain.getValueObject(value));
}

handleKeyPress = (event: SyntheticKeyboardEvent<HTMLInputElement>) => {
handleKeyDown = (event: SyntheticKeyboardEvent<HTMLInputElement>) => {
if (event.key === 'Enter') {
this.props.onEnterKey();
}
Expand All @@ -41,7 +41,7 @@ class FromDateFilterPlain extends Component<Props> {
<div>
{/* $FlowFixMe[cannot-spread-inexact] automated comment */}
<D2Date
onKeyPress={this.handleKeyPress}
onKeyDown={this.handleKeyDown}
onBlur={this.handleBlur}
placeholder={i18n.t('From')}
width={150}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class ToDateFilterPlain extends Component<Props> {
this.props.onBlur(ToDateFilterPlain.getValueObject(value));
}

handleKeyPress = (event: SyntheticKeyboardEvent<HTMLInputElement>) => {
handleKeyDown = (event: SyntheticKeyboardEvent<HTMLInputElement>) => {
if (event.key === 'Enter') {
this.props.onEnterKey(ToDateFilterPlain.getValueObject(this.props.value || ''));
}
Expand All @@ -48,7 +48,7 @@ class ToDateFilterPlain extends Component<Props> {
<div>
{/* $FlowFixMe[cannot-spread-inexact] automated comment */}
<D2Date
onKeyPress={this.handleKeyPress}
onKeyDown={this.handleKeyDown}
onBlur={this.handleBlur}
onDateSelectedFromCalendar={this.handleDateSelectedFromCalendar}
placeholder={i18n.t('To')}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ type Props = {
inputWidth?: ?number,
onBlur: (value: string) => void,
onFocus?: ?() => void,
onKeyDown?: ?() => void,
onDateSelectedFromCalendar?: () => void,
classes?: Object,
disabled?: boolean,
Expand Down

0 comments on commit 1ff177d

Please sign in to comment.