Const
Create a focus trap that keeps focus within a container element.
The focus trap:
// In a dialog componentconst element = yield* contentRef.get;yield* FocusTrap.make({ container: element, returnFocus: triggerElement,});// Focus is now trapped within the dialog// When scope closes, focus returns to triggerElement Copy
// In a dialog componentconst element = yield* contentRef.get;yield* FocusTrap.make({ container: element, returnFocus: triggerElement,});// Focus is now trapped within the dialog// When scope closes, focus returns to triggerElement
Create a focus trap that keeps focus within a container element.
The focus trap: