How to use the focus-trap.deactivate function in focus-trap

To help you get started, we’ve selected a few focus-trap examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github springload / frontend-starter-kit / core / static_src / js / components / modals / Modal.js View on Github external
afterClose() {
        focusTrap.deactivate(this.refs.modal);
        this.props.onAfterClose();
    },
github Automattic / jetpack / _inc / client / components / modal / index.jsx View on Github external
componentWillUnmount() {
		jQuery( 'body' )
			.removeClass( 'dops-modal-showing' )
			.off( 'touchmove.dopsmodal', false );
		jQuery( document ).unbind( 'keyup', this.handleEscapeKey );
		try {
			focusTrap.deactivate();
		} catch ( e ) {
			//noop
		}
	}

focus-trap

Trap focus within a DOM node.

MIT
Latest version published 7 months ago

Package Health Score

90 / 100
Full package analysis