use-focus-within
Detects if any element within the given element has focus
Source
Docs
Package
Usage
The use-focus-within hook detects if any element within another element has focus.
It works the same way as the :focus-within CSS selector:
One of elements has focus: false
Definition
Exported types
UseFocusWithinOptions and UseFocusWithinReturnValue types are exported from the @mantine/hooks package;
you can import them in your application: