Skip to content

Commit

Permalink
[Fleet] Do not show error state on input if there are no errors
Browse files Browse the repository at this point in the history
  • Loading branch information
hop-dev committed May 9, 2023
1 parent 352c8d8 commit 71e4f5a
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export const PackagePolicyInputVarField: React.FunctionComponent<{
}) => {
const [isDirty, setIsDirty] = useState<boolean>(false);
const { multi, required, type, title, name, description, options } = varDef;
const isInvalid = (isDirty || forceShowErrors) && !!varErrors;
const isInvalid = (isDirty || forceShowErrors) && !!varErrors?.length;
const errors = isInvalid ? varErrors : null;
const fieldLabel = title || name;
const fieldTestSelector = fieldLabel.replace(/\s/g, '-').toLowerCase();
Expand Down

0 comments on commit 71e4f5a

Please sign in to comment.