Skip to content

Commit

Permalink
Update Modal.svelte
Browse files Browse the repository at this point in the history
  • Loading branch information
brodysmith1 committed Feb 15, 2024
1 parent d37f8ba commit c47db9b
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/lib/components/Modal.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
export let durationOut = 100
export let hideCloseButton = false
export let showHeader = false
export let ariaRole: "dialog" | "presentation" = "dialog"
const handleKeydown = (e: KeyboardEvent) => {
if (e.key === "Escape") {
Expand All @@ -30,12 +31,12 @@
<div
{id}
class="modal-screen font-sans {classList}"
class:has-title={title}
role="dialog"
tabindex="-1"
aria-modal="true"
role={ariaRole}
aria-modal={ariaRole === "dialog"}
class:fullscreen
class:error={isError}
class:has-title={title}
class:w-full={fullWidth}
class:show-header={showHeader}
on:click={close}
Expand All @@ -46,9 +47,9 @@
<!-- svelte-ignore a11y-no-noninteractive-element-interactions -->
<div
class="modal"
role="dialog"
tabindex="-1"
aria-modal="true"
role={ariaRole}
aria-modal={ariaRole === "dialog"}
on:click={(e) => !fullscreen && e.stopPropagation()}
on:keydown={(e) => !fullscreen && e.stopPropagation()}
>
Expand Down

0 comments on commit c47db9b

Please sign in to comment.