commits
* Upgrade Rollup dependencies
* Update Rollup build process
* Replace husky-v4
* Update selection restoration implementation
* Simplify getFocusTargets
* Simplify focus utilities
* Simplify click helpers
* Simplify usePriority
* Remove unnecessary utility function
* make ssr-friendly for next.js
* Update src/utils/observeScrollArea.ts
Co-authored-by: Phil Pluckthun <phil@kitten.sh>
---------
Co-authored-by: Phil Pluckthun <phil@kitten.sh>
Update Cypress and related deps
Restore selection in focus hooks when target focus is invalid,
i.e. not in the original focus target.
Nested useDismissable's would still trigger if the nested element
contains focus, since they're nested. This would trigger an
unintentional cascade dismiss.
In modals and dialogs we'll generally only move focus to
the first target, if said target is marked with `[autofocus]`
otherwise we'll focus the dialog/modal element itself and
let the regular tab order kick in.
See: https://github.com/KittyGiraudel/a11y-dialog/blob/b7da40433682ee01798aa601c41c3ae8869e6719/a11y-dialog.js#L310-L314
When SVGElements are checked for visibility, they'll fail the check
since `offsetWidth` and `offsetHeight` aren't present on them. The
`clientWidth` and `clientHeight` properties may not be used as they
refer to the inset size of potentially hidden but scrollable elements.
Instead, we can only rely on the bounding check and add an exception for
hidden inputs.
See: https://github.com/focus-trap/tabbable/blob/b9c50fea90d392a409c8055001567c4b5d0cac54/src/index.js#L143-L161
In modals and dialogs we'll generally only move focus to
the first target, if said target is marked with `[autofocus]`
otherwise we'll focus the dialog/modal element itself and
let the regular tab order kick in.
See: https://github.com/KittyGiraudel/a11y-dialog/blob/b7da40433682ee01798aa601c41c3ae8869e6719/a11y-dialog.js#L310-L314
When SVGElements are checked for visibility, they'll fail the check
since `offsetWidth` and `offsetHeight` aren't present on them. The
`clientWidth` and `clientHeight` properties may not be used as they
refer to the inset size of potentially hidden but scrollable elements.
Instead, we can only rely on the bounding check and add an exception for
hidden inputs.
See: https://github.com/focus-trap/tabbable/blob/b9c50fea90d392a409c8055001567c4b5d0cac54/src/index.js#L143-L161