From 74a239ae24f3fc3d6b8c516de805d5b76ac5bf8f Mon Sep 17 00:00:00 2001 From: Danny Rorabaugh Date: Tue, 6 Aug 2024 11:49:38 -0400 Subject: [PATCH] Revert "Clear vern selection when user returns to vern text field (#3290)" This reverts commit 474ec40e429bdc14d0b68448b2766ae624eed7dd. --- .../EntryCellComponents/VernWithSuggestions.tsx | 2 -- .../DataEntry/DataEntryTable/NewEntry/index.tsx | 8 -------- 2 files changed, 10 deletions(-) diff --git a/src/components/DataEntry/DataEntryTable/EntryCellComponents/VernWithSuggestions.tsx b/src/components/DataEntry/DataEntryTable/EntryCellComponents/VernWithSuggestions.tsx index 661ce52c9e..6b63a6e759 100644 --- a/src/components/DataEntry/DataEntryTable/EntryCellComponents/VernWithSuggestions.tsx +++ b/src/components/DataEntry/DataEntryTable/EntryCellComponents/VernWithSuggestions.tsx @@ -19,7 +19,6 @@ interface VernWithSuggestionsProps { updateVernField: (newValue: string, openDialog?: boolean) => void; onBlur: () => void; onClose?: (e: SyntheticEvent, reason: AutocompleteCloseReason) => void; - onFocus?: () => void; suggestedVerns?: string[]; handleEnter: () => void; vernacularLang: WritingSystem; @@ -52,7 +51,6 @@ export default function VernWithSuggestions( // onChange is triggered when an option is selected props.updateVernField(value ?? "", true); }} - onFocus={props.onFocus} onInputChange={(_e, value) => { // onInputChange is triggered by typing props.updateVernField(value); diff --git a/src/components/DataEntry/DataEntryTable/NewEntry/index.tsx b/src/components/DataEntry/DataEntryTable/NewEntry/index.tsx index 361ef56ad0..00fd98edf3 100644 --- a/src/components/DataEntry/DataEntryTable/NewEntry/index.tsx +++ b/src/components/DataEntry/DataEntryTable/NewEntry/index.tsx @@ -221,13 +221,6 @@ export default function NewEntry(props: NewEntryProps): ReactElement { } }; - /** Clear the duplicate selection if user returns to the vernacular field. */ - const handleOnVernFocus = (): void => { - if (selectedDup) { - setSelectedDup(); - } - }; - const handleCloseVernDialog = (id?: string): void => { if (id !== undefined) { setSelectedDup(id); @@ -267,7 +260,6 @@ export default function NewEntry(props: NewEntryProps): ReactElement { setVernOpen(true); } }} - onFocus={handleOnVernFocus} suggestedVerns={suggestedVerns} // To prevent unintentional no-gloss submissions: // If enter pressed from the vern field, check whether gloss is empty