Files
static-cms/src/components/UI/Dialog/FocusTrap.js
Shawn Erquhart 6b45a46a39 add media library
* rebase editorial workflow pull requests when behind

* fix async/await transpilation

* add media library pagination

* switch media library to grid layout

* ensure that only cms branches can be force updated
2017-11-08 15:00:28 -05:00

17 lines
595 B
JavaScript

import React from 'react';
import FocusTrapReact from 'focus-trap-react';
/**
* A wrapper for focus-trap-react, which we use to completely remove focus traps
* from the DOM rather than using the library's own internal activation/pausing
* mechanisms, which can manifest bugs when nested.
*/
const FocusTrap = props => {
const { active, children, focusTrapOptions, className } = props;
return active
? <FocusTrapReact focusTrapOptions={focusTrapOptions} className={className}>{children}</FocusTrapReact>
: <div className={className}>{children}</div>
}
export default FocusTrap;