Help and docs
Sign in

R62 feat: focus the element under a left click

Browse files
grindlemire 23d 13 files +456 ~36
Landed bygrindlemireas 9599fc12 · with 7 other reviews See in history
You are on patch 2. Patch 3 was pushed 23d ago Go to patch 3

A left press now focuses the nearest element at or above the pointer that
is in the Tab order, the way a browser does, so clicking an or

lets you type in it. A click with no tab stop there leaves focus alone, and an open modal limits it to the modal's content. The hover example's input now says click or Tab to focus. Clicks make focus jump around the tree far more than Tab did, which exposed that a re-render restored focus by its index in the focus list. Adding a focusable earlier in the tree, reordering keyed rows, or switching pages moved focus to whatever element now sat at that index, and an unmounted Input kept claiming keys. Focus is now found again by the component that rendered the element, plus its key path or its position among that component's focusables; when it is gone it gets its blur and nothing is focused. Modals restore focus the same way on close.
Latest