Skip to content

Commit

Permalink
Revert "Clear vern selection when user returns to vern text field (#3290
Browse files Browse the repository at this point in the history
)"

This reverts commit 474ec40.
  • Loading branch information
imnasnainaec committed Aug 6, 2024
1 parent fea400d commit 74a239a
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down
8 changes: 0 additions & 8 deletions src/components/DataEntry/DataEntryTable/NewEntry/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 74a239a

Please sign in to comment.