added aria-expanded to the dropdown triggers

This commit is contained in:
Gani Georgiev committed 2024-04-05 23:15:11 +03:00
1 parent a9d468a863
commit 4dc8a10af5
37 files changed
+60 -60

No files matched your search

+3 -1
View File
@@ -1,5 +1,5 @@
<script>
import { onMount, createEventDispatcher } from "svelte";
import { createEventDispatcher, onMount } from "svelte";
import { fly } from "svelte/transition";
export let trigger = undefined;
@@ -25,9 +25,11 @@
$: if (active) {
activeTrigger?.classList?.add("active");
activeTrigger?.setAttribute("aria-expanded", true);
dispatch("show");
} else {
activeTrigger?.classList?.remove("active");
activeTrigger?.setAttribute("aria-expanded", false);
dispatch("hide");
}