mirror of
https://github.com/olehomelchenko/astrolabe.git
synced 2026-08-08 02:02:33 +00:00
Chart builder: SelectControl pickers, channel chooser, per-type aggregates
This commit is contained in:
@@ -421,6 +421,13 @@ open, wraps `Tab`/`Shift+Tab` within the modal, and restores focus on close. The
|
||||
optional `initialSelector` picks _which_ child takes focus (e.g. Cancel for a
|
||||
destructive confirm); it falls back to the first focusable child.
|
||||
|
||||
The trap wraps Tab **only within the shell element**: content portaled to
|
||||
`<body>` (a `SelectControl` panel or other disclosure popover opened from inside
|
||||
a modal) is outside both the trap's DOM subtree and its keydown listener. Such
|
||||
popovers must therefore handle Tab themselves — close and refocus their trigger
|
||||
(the native-select convention) — so focus can't strand outside the dialog while
|
||||
it is open.
|
||||
|
||||
```ts
|
||||
// src/app/hooks/useFocusTrap.ts
|
||||
import { useRef, useEffect } from 'react';
|
||||
|
||||
Reference in New Issue
Block a user