mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-20 01:41:26 +02:00
feat(shared-ui): add focusTrap action and apply to shared Modal
Create reusable Svelte action for focus trapping in modals/dialogs. Traps Tab/Shift+Tab within element and restores focus on destroy. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
8bc52f4264
commit
c27f6f88f0
4 changed files with 75 additions and 0 deletions
|
|
@ -2,6 +2,7 @@
|
|||
import type { Snippet } from 'svelte';
|
||||
import { X } from '@manacore/shared-icons';
|
||||
import Text from '../atoms/Text.svelte';
|
||||
import { focusTrap } from '../actions/focusTrap';
|
||||
|
||||
interface Props {
|
||||
visible: boolean;
|
||||
|
|
@ -60,6 +61,7 @@
|
|||
role="dialog"
|
||||
aria-modal="true"
|
||||
tabindex="-1"
|
||||
use:focusTrap
|
||||
>
|
||||
<!-- Modal Content -->
|
||||
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue