File tree 1 file changed +11
-1
lines changed
src/renderers/dom/client/wrappers
1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -216,10 +216,20 @@ var ReactDOMInput = {
216
216
} ,
217
217
218
218
postMountWrapper : function ( inst ) {
219
+ var props = inst . _currentElement . props ;
220
+
219
221
// This is in postMount because we need access to the DOM node, which is not
220
222
// available until after the component has mounted.
221
223
var node = ReactDOMComponentTree . getNodeFromInstance ( inst ) ;
222
- node . value = node . value ; // Detach value from defaultValue
224
+
225
+ // Detach value from defaultValue. We won't do anything if we're working on
226
+ // submit or reset inputs as those values & defaultValues are linked. They
227
+ // are not resetable nodes so this operation doesn't matter and actually
228
+ // removes browser-default values (eg "Submit Query") when no value is
229
+ // provided.
230
+ if ( props . type !== 'submit' && props . type !== 'reset' ) {
231
+ node . value = node . value ;
232
+ }
223
233
224
234
// Normally, we'd just do `node.checked = node.checked` upon initial mount, less this bug
225
235
// this is needed to work around a chrome bug where setting defaultChecked
You can’t perform that action at this time.
0 commit comments