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';
|
||||
import { slide } from 'svelte/transition';
|
||||
import {
|
||||
@@ -41,7 +42,7 @@
|
||||
<svelte:window onkeydown={handleKeydown} />
|
||||
|
||||
<button class="backdrop" aria-label="Close battery details" onclick={onclose}></button>
|
||||
<div class="popover" role="dialog" aria-label="Battery details">
|
||||
<div class="popover" role="dialog" aria-modal="true" aria-label="Battery details" tabindex="-1" use:focusTrap>
|
||||
<div class="popover-surface" class:charging={battery.charging} class:low={isLow}>
|
||||
<header class="summary">
|
||||
<span class="battery-icon">
|
||||
|
||||
Reference in new issue
Block a user