File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
packages/react-dom/src/client Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -207,7 +207,7 @@ export function postMountWrapper(
207
207
return ;
208
208
}
209
209
210
- const node : HTMLInputElement = element ;
210
+ const node = ( ( element : any ) : HTMLInputElement ) ;
211
211
212
212
// Do not assign value if it is already set. This prevents user text input
213
213
// from being lost during SSR hydration.
@@ -219,7 +219,7 @@ export function postMountWrapper(
219
219
// default value provided by the browser. See: #12872
220
220
if ( type === 'submit' || type === 'reset' ) {
221
221
if ( value !== undefined && value !== null ) {
222
- node . setAttribute ( 'value' , value ) ;
222
+ node . setAttribute ( 'value' , toString ( value ) ) ;
223
223
}
224
224
225
225
return ;
@@ -229,15 +229,15 @@ export function postMountWrapper(
229
229
// potentially avoids a DOM write and prevents Firefox (~60.0.1) from
230
230
// prematurely marking required inputs as invalid
231
231
if ( value !== '' ) {
232
- node . value = value ;
232
+ node . value = toString ( value ) ;
233
233
}
234
234
}
235
235
236
236
if ( props . hasOwnProperty ( 'defaultValue' ) ) {
237
237
// value must be assigned before defaultValue. This fixes an issue where the
238
238
// visually displayed value of date inputs disappears on mobile Safari and Chrome:
239
239
// https://github.com/facebook/react/issues/7233
240
- node . defaultValue = getToStringValue ( props . defaultValue ) ;
240
+ node . defaultValue = toString ( getToStringValue ( props . defaultValue ) ) ;
241
241
}
242
242
243
243
if (
You can’t perform that action at this time.
0 commit comments