dillon1000/react

Commit

Do not assign node.value on input creation if no change will occur (#12925)

This commit fixes an issue where assigning an empty string to required
text inputs triggers the invalid state in Firefox (~60.0.1).

It does this by first comparing the initial state value to the current
value property on the text element. This:

1. Prevents the validation issue
2. Avoids an extra DOM Mutation in some cases
Browse files
Changed paths2 files
First-parent comparison
M fixtures/dom/src/components/fixtures/text-inputs/index.js ModifiedM packages/react-dom/src/client/ReactDOMFiberInput.js Modified
Patch

Files changed

Rendering syntax-highlighted changes…