File tree Expand file tree Collapse file tree 1 file changed +4
-9
lines changed
packages/react/src/field/control Expand file tree Collapse file tree 1 file changed +4
-9
lines changed Original file line number Diff line number Diff line change @@ -126,15 +126,10 @@ export const FieldControl = React.forwardRef(function FieldControl(
126126 'aria-labelledby' : labelId ,
127127 ...( isControlled ? { value } : { defaultValue } ) ,
128128 onChange ( event ) {
129- if ( value != null ) {
130- setValue (
131- event . currentTarget . value ,
132- createBaseUIEventDetails ( 'none' , event . nativeEvent ) ,
133- ) ;
134- }
135-
136- setDirty ( event . currentTarget . value !== validityData . initialValue ) ;
137- setFilled ( event . currentTarget . value !== '' ) ;
129+ const inputValue = event . currentTarget . value ;
130+ setValue ( inputValue , createBaseUIEventDetails ( 'none' , event . nativeEvent ) ) ;
131+ setDirty ( inputValue !== validityData . initialValue ) ;
132+ setFilled ( inputValue !== '' ) ;
138133 } ,
139134 onFocus ( ) {
140135 setFocused ( true ) ;
You can’t perform that action at this time.
0 commit comments