Skip to content

Commit

Permalink
Cluster name show validation message when typing characters
Browse files Browse the repository at this point in the history
  • Loading branch information
ammont82 committed Mar 8, 2024
1 parent 8a0e737 commit 65c8267
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions libs/ui-lib/lib/common/components/ui/formik/RichInputField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ const RichInputField: React.FC<RichInputFieldPropsProps> = React.forwardRef(
validate,
idPostfix,
richValidationMessages,
noDefaultOnChange,
onChange,
...props
},
ref: React.Ref<HTMLInputElement>,
Expand Down Expand Up @@ -118,7 +120,15 @@ const RichInputField: React.FC<RichInputFieldPropsProps> = React.forwardRef(
id={fieldId}
isRequired={isRequired}
aria-describedby={`${fieldId}-helper`}
onChange={(event) => {
!popoverOpen && setPopoverOpen(true);
!noDefaultOnChange && field.onChange(event);
onChange && onChange(event);
}}
className="rich-input__text"
onBlur={() => {
setPopoverOpen(false);
}}
/>
</InputGroupItem>
<InputGroupItem>
Expand All @@ -135,6 +145,7 @@ const RichInputField: React.FC<RichInputFieldPropsProps> = React.forwardRef(
richValidationMessages={richValidationMessages as Record<string, string>}
/>
}
withFocusTrap={false}
>
<Button variant="plain" aria-label="Validation">
{!isValid ? (
Expand Down

0 comments on commit 65c8267

Please sign in to comment.