dillon1000/react

Commit

Extend input type check in selection capabilities (#12062) (#12135)

* Do not set selection when prior selection is undefined (#12062)

`restoreSelection` did not account for input elements that have changed
type after the commit phase. The new `text` input supported selection
but the old `email` did not and `setSelection` was incorrectly trying to
restore `null` selection state.

We also extend input type check in selection capabilities to cover cases
where input type is `search`, `tel`, `url`, or `password`.

* Add link to HTML spec for element types and selection

* Add reset button to ReplaceEmailInput

This commit adds a button to restore the original state of the
ReplaceEmailInput fixture so that it can be run multiple times without
refreshing the page.
Browse files
Changed paths3 files
First-parent comparison
A fixtures/dom/src/components/fixtures/text-inputs/ReplaceEmailInput.js AddedM fixtures/dom/src/components/fixtures/text-inputs/index.js ModifiedM packages/react-dom/src/client/ReactInputSelection.js Modified
Patch

Files changed

Rendering syntax-highlighted changes…