dillon1000/react

Commit

Add blur() and focusLast() to fragment instances (#32654)

`focus()` was added in https://github.com/facebook/react/pull/32465.
Here we add `focusLast()` and `blur()`. I also extended `focus` to take
options.

`focus` will focus the first focusable element. `focusLast` will focus
the last focusable element. We could consider a `focusFirst` naming or
even the `focusWithin` used by test selector APIs as well.

`blur` will only have an effect if the current `document.activeElement`
is one of the fragment children.
Browse files
Changed paths6 files
First-parent comparison
A fixtures/dom/src/components/fixtures/fragment-refs/FocusCase.js AddedM fixtures/dom/src/components/fixtures/fragment-refs/index.js ModifiedM fixtures/dom/src/style.css ModifiedM packages/react-dom-bindings/src/client/ReactFiberConfigDOM.js ModifiedM packages/react-dom/src/__tests__/ReactDOMFragmentRefs-test.js ModifiedM packages/react-reconciler/src/ReactFiberTreeReflection.js Modified
Patch

Files changed

Rendering syntax-highlighted changes…