Files
immich/web/src/lib/actions/__test__/FocusTrapTest.svelte
T
Freddie Floydd b9ca68f6e4 chore(web): rename components to PascalCase (#28013)
chore: rename components to PascalCase
2026-04-21 12:29:42 -04:00

24 lines
562 B
Svelte

<script lang="ts">
import { focusTrap } from '$lib/actions/focus-trap';
interface Props {
show: boolean;
active?: boolean;
}
let { show = $bindable(), active = $bindable() }: Props = $props();
</script>
<button type="button" onclick={() => (show = true)}>Open</button>
{#if show}
<div use:focusTrap={{ active }}>
<div>
<span>text</span>
<button data-testid="one" type="button" onclick={() => (show = false)}>Close</button>
</div>
<input data-testid="two" disabled />
<input data-testid="three" />
</div>
{/if}