@@ -5,15 +5,14 @@ import {
5
5
FormGroup ,
6
6
HelperTextItem ,
7
7
TextInput ,
8
- HelperText as PFHelperText ,
8
+ HelperText ,
9
9
HelperTextItemProps ,
10
10
Popover ,
11
11
PopoverPosition ,
12
12
InputGroup ,
13
13
Button ,
14
14
InputGroupItem ,
15
15
FormHelperText ,
16
- HelperText ,
17
16
} from '@patternfly/react-core' ;
18
17
import { CheckCircleIcon } from '@patternfly/react-icons/dist/js/icons/check-circle-icon' ;
19
18
import { CheckIcon } from '@patternfly/react-icons/dist/js/icons/check-icon' ;
@@ -58,7 +57,7 @@ export const RichValidation: React.FC<RichValidationProps> = ({
58
57
richValidationMessages,
59
58
} ) => {
60
59
return (
61
- < PFHelperText component = "ul" className = "rich-input__rules" >
60
+ < HelperText component = "ul" className = "rich-input__rules" >
62
61
{ Object . keys ( richValidationMessages ) . map ( ( key ) => {
63
62
const variant = getHelperTextVariant ( richValidationMessages [ key ] , value , error ) ;
64
63
return (
@@ -67,7 +66,7 @@ export const RichValidation: React.FC<RichValidationProps> = ({
67
66
</ HelperTextItem >
68
67
) ;
69
68
} ) }
70
- </ PFHelperText >
69
+ </ HelperText >
71
70
) ;
72
71
} ;
73
72
@@ -99,6 +98,12 @@ const RichInputField: React.FC<RichInputFieldPropsProps> = React.forwardRef(
99
98
const fieldId = getFieldId ( props . name , 'input' , idPostfix ) ;
100
99
const isValid = ! ( touched && error ?. length ) ;
101
100
101
+ React . useEffect ( ( ) => {
102
+ if ( value !== '' ) {
103
+ setPopoverOpen ( true ) ;
104
+ }
105
+ } , [ value ] ) ;
106
+
102
107
return (
103
108
< FormGroup
104
109
id = { `form-control__${ fieldId } ` }
@@ -128,6 +133,7 @@ const RichInputField: React.FC<RichInputFieldPropsProps> = React.forwardRef(
128
133
shouldOpen = { ( ) => setPopoverOpen ( true ) }
129
134
aria-label = "validation popover"
130
135
position = { PopoverPosition . top }
136
+ withFocusTrap = { false }
131
137
bodyContent = {
132
138
< RichValidation
133
139
value = { value }
0 commit comments