Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
componentDidMount() {
jQuery( 'body' )
.addClass( 'dops-modal-showing' )
.on( 'touchmove.dopsmodal', false );
jQuery( document ).keyup( this.handleEscapeKey );
try {
focusTrap.activate( ReactDOM.findDOMNode( this ), {
// onDeactivate: this.maybeClose,
initialFocus: this.props.initialFocus,
} );
} catch ( e ) {
//noop
}
}
setFocusTrap() {
const { modal, content } = this.refs;
const tabbableItems = tabbable(content);
if (tabbableItems.length > 0) {
focusTrap.activate(modal);
}
},