@wordpress/compose
Version:
WordPress higher-order components (HOCs).
28 lines (19 loc) • 600 B
Markdown
In Dialogs/modals, the tabbing must be constrained to the content of the wrapper element. To achieve this behavior you can use the `useConstrainedTabbing` hook.
- Type: `Object|Function`
A function reference that must be passed to the DOM element where constrained tabbing should be enabled.
```jsx
import { useConstrainedTabbing } from '@wordpress/compose';
const ConstrainedTabbingExample = () => {
const ref = useConstrainedTabbing();
return (
<div ref={ ref }>
<Button />
<Button />
</div>
);
};
```