dillon1000/react
Commit
Browse files 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.
Changed paths6 files
First-parent comparisonfixtures/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 ModifiedPatch
Files changed
Rendering syntax-highlighted changes…