From 8a2ab6bbc1fc6663bdfdacaff05dee782f87e473 Mon Sep 17 00:00:00 2001 From: Cee Chen Date: Wed, 24 Jul 2024 09:50:11 -0700 Subject: [PATCH] Fix pasting duplicate text :facepalm: It worked in Firefox but not in webkit, derp --- .../super_date_picker/date_popover/absolute_tab.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/eui/src/components/date_picker/super_date_picker/date_popover/absolute_tab.tsx b/packages/eui/src/components/date_picker/super_date_picker/date_popover/absolute_tab.tsx index f0e288e987d..8fe9d378b14 100644 --- a/packages/eui/src/components/date_picker/super_date_picker/date_popover/absolute_tab.tsx +++ b/packages/eui/src/components/date_picker/super_date_picker/date_popover/absolute_tab.tsx @@ -81,11 +81,13 @@ export const EuiAbsoluteTab: FunctionComponent = ({ ); const handleTextChange = useCallback( (event: ChangeEvent) => { + if (isReadyToParse) return; // Text paste event, don't continue + setTextInputValue(event.target.value); setHasUnparsedText(true); setIsTextInvalid(false); }, - [] + [isReadyToParse] ); const submitButtonLabel = useEuiI18n(