v1.7.0
Minor Changes
-
#45
69f149fThanks @MikeNotThePope! - AddFocusTrapanduseFocusTrap(steal from React Aria).React Aria's hallmark is rigorous focus management, and its
FocusScopeis the piece every custom overlay needs. This ports that idea as a reusable primitive that works on any region — not just built-in overlays.FocusTrapcomponent (main entry) anduseFocusTraphook (/hooksentry).- Moves focus inside on activation, cycles Tab / Shift+Tab within the region, and restores focus to the previously focused element on deactivation (
restoreFocus, on by default). - Dependency-free and SSR-safe. Unit-tested, with a story and docs.