Skip to content

Commit

Permalink
[NewEntry] When vern dialog closed sans choice, select text (#3306)
Browse files Browse the repository at this point in the history
  • Loading branch information
imnasnainaec authored Aug 20, 2024
1 parent 0ae6b66 commit 559a2de
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/components/DataEntry/DataEntryTable/NewEntry/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
};
Expand Down

0 comments on commit 559a2de

Please sign in to comment.