From 559a2deaeff235ba3444661b8ca599b3555fc545 Mon Sep 17 00:00:00 2001 From: "D. Ror." Date: Tue, 20 Aug 2024 13:07:24 -0400 Subject: [PATCH] [NewEntry] When vern dialog closed sans choice, select text (#3306) --- src/components/DataEntry/DataEntryTable/NewEntry/index.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/components/DataEntry/DataEntryTable/NewEntry/index.tsx b/src/components/DataEntry/DataEntryTable/NewEntry/index.tsx index 162fa7f64d..43a8cafe00 100644 --- a/src/components/DataEntry/DataEntryTable/NewEntry/index.tsx +++ b/src/components/DataEntry/DataEntryTable/NewEntry/index.tsx @@ -224,6 +224,10 @@ export default function NewEntry(props: NewEntryProps): ReactElement { const handleCloseVernDialog = (id?: string): void => { if (id !== undefined) { setSelectedDup(id); + } else { + // User closed the dialog without choosing a duplicate entry or new entry. + // Highlight-select the typed vernacular for easy deletion. + vernInput.current?.setSelectionRange(0, vernInput.current.value.length); } setVernOpen(false); };