Skip to content

Commit

Permalink
fix(VariantManagement): fix "Manage Views" default validation (#5798)
Browse files Browse the repository at this point in the history
Fixes #5766
  • Loading branch information
Lukas742 committed May 15, 2024
1 parent f1d18d8 commit 2f3263b
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,10 @@ export const ManageViewsTableRows = (props: ManageViewsTableRowsProps) => {
props.manageViewsInputProps?.onInput(e);
}
const trimmedValue = trimAndRemoveSpaces(e.target.value);
if (variantNames.includes(trimmedValue) || Array.from(changedVariantNames.values()).includes(trimmedValue)) {
if (
children !== trimmedValue &&
(variantNames.includes(trimmedValue) || Array.from(changedVariantNames.values()).includes(trimmedValue))
) {
setVariantNameInvalid(errorTextAlreadyExists);
setInvalidVariants((prev) => ({ ...prev, [`${children}`]: inputRef.current }));
handleRowChange(e, { currentVariant: children, children: trimmedValue });
Expand Down

0 comments on commit 2f3263b

Please sign in to comment.