File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
client/packages/lowcoder/src/comps/comps/textInputComp Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -169,6 +169,7 @@ export const textInputProps = (props: RecordConstructorToView<typeof textInputCh
169169export const useTextInputProps = ( props : RecordConstructorToView < typeof textInputChildren > ) => {
170170 const [ validateState , setValidateState ] = useState ( { } ) ;
171171 const changeRef = useRef ( false )
172+ const touchRef = useRef ( false ) ;
172173
173174 const propsRef = useRef < RecordConstructorToView < typeof textInputChildren > > ( props ) ;
174175 propsRef . current = props ;
@@ -195,9 +196,23 @@ export const useTextInputProps = (props: RecordConstructorToView<typeof textInpu
195196 changeRef . current = false ;
196197 } , [ inputValue ] ) ;
197198
199+ useEffect ( ( ) => {
200+ if ( ! touchRef . current ) return ;
201+
202+ setValidateState (
203+ textInputValidate ( {
204+ ...propsRef . current ,
205+ value : {
206+ value : props . value . value ,
207+ } ,
208+ } )
209+ ) ;
210+ } , [ props . customRule ] )
211+
198212 const handleChange = ( e : ChangeEvent < HTMLInputElement > ) => {
199213 props . value . onChange ( e . target . value ) ;
200214 changeRef . current = true ;
215+ touchRef . current = true ;
201216 } ;
202217
203218 return [
You can’t perform that action at this time.
0 commit comments