Trap keyboard focus in popovers
This commit is contained in:
1 parent
2432113c7f
commit
411fb03c22
6 files changed
+61
-5
No files matched your search
@@ -1,4 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { focusTrap } from '#lib/ui/focusTrap';
|
||||
import Icon from '@iconify/svelte';
|
||||
|
||||
let { donateUrl, discordUrl, onclose }: { donateUrl: string; discordUrl: string; onclose: () => void } = $props();
|
||||
@@ -11,7 +12,7 @@
|
||||
<svelte:window onkeydown={handleKeydown} />
|
||||
|
||||
<button class="backdrop" aria-label="Close donate card" onclick={onclose}></button>
|
||||
<div class="popover" role="dialog" aria-label="Support me">
|
||||
<div class="popover" role="dialog" aria-modal="true" aria-label="Support me" tabindex="-1" use:focusTrap>
|
||||
<div class="popover-surface">
|
||||
<header class="header">
|
||||
<Icon icon="simple-icons:kofi" width="22" />
|
||||
|
||||
Reference in new issue
Block a user