From 1ff177d524513cec89f0c3058f5ae432072d2e0f Mon Sep 17 00:00:00 2001 From: alaa-yahia Date: Mon, 19 Aug 2024 11:32:11 +0300 Subject: [PATCH] fix: replace onKeyPress with onKeyDown --- .../components/FiltersForTypes/Date/From.component.js | 4 ++-- .../components/FiltersForTypes/Date/To.component.js | 4 ++-- .../FormFields/DateAndTime/D2Date/D2Date.component.js | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/core_modules/capture-core/components/FiltersForTypes/Date/From.component.js b/src/core_modules/capture-core/components/FiltersForTypes/Date/From.component.js index ff8cce189b..b43b56a245 100644 --- a/src/core_modules/capture-core/components/FiltersForTypes/Date/From.component.js +++ b/src/core_modules/capture-core/components/FiltersForTypes/Date/From.component.js @@ -29,7 +29,7 @@ class FromDateFilterPlain extends Component { this.props.onBlur(FromDateFilterPlain.getValueObject(value)); } - handleKeyPress = (event: SyntheticKeyboardEvent) => { + handleKeyDown = (event: SyntheticKeyboardEvent) => { if (event.key === 'Enter') { this.props.onEnterKey(); } @@ -41,7 +41,7 @@ class FromDateFilterPlain extends Component {
{/* $FlowFixMe[cannot-spread-inexact] automated comment */} { this.props.onBlur(ToDateFilterPlain.getValueObject(value)); } - handleKeyPress = (event: SyntheticKeyboardEvent) => { + handleKeyDown = (event: SyntheticKeyboardEvent) => { if (event.key === 'Enter') { this.props.onEnterKey(ToDateFilterPlain.getValueObject(this.props.value || '')); } @@ -48,7 +48,7 @@ class ToDateFilterPlain extends Component {
{/* $FlowFixMe[cannot-spread-inexact] automated comment */} void, onFocus?: ?() => void, + onKeyDown?: ?() => void, onDateSelectedFromCalendar?: () => void, classes?: Object, disabled?: boolean,