diff options
author | metamuffin <metamuffin@disroot.org> | 2024-04-01 00:50:46 +0200 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2024-04-01 00:50:46 +0200 |
commit | 5b3fb138a584649782ea92df262d0a78c5386f4d (patch) | |
tree | 4d74dd2ab406d6000e800ce64d16c2201dc038ba /client-web/source/helper.ts | |
parent | 78a02af787a4011a60f2ec964da9130c737478d4 (diff) | |
download | keks-meet-5b3fb138a584649782ea92df262d0a78c5386f4d.tar keks-meet-5b3fb138a584649782ea92df262d0a78c5386f4d.tar.bz2 keks-meet-5b3fb138a584649782ea92df262d0a78c5386f4d.tar.zst |
improve accessability here and there
Diffstat (limited to 'client-web/source/helper.ts')
-rw-r--r-- | client-web/source/helper.ts | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/client-web/source/helper.ts b/client-web/source/helper.ts index 655d894..49ec121 100644 --- a/client-web/source/helper.ts +++ b/client-web/source/helper.ts @@ -17,9 +17,9 @@ interface Opts<E> { alt?: string, onclick?: (e: E) => void, onchange?: (e: E) => void, - role?: "dialog" + role?: "dialog" | "separator" | "switch" | "button" | "log" | "group", aria_label?: string - aria_live?: "polite" | "assertive" + aria_live?: "polite" | "assertive" | "off", aria_modal?: boolean aria_popup?: "menu" icon?: string, @@ -36,6 +36,7 @@ function apply_opts<E extends HTMLElement>(el: E, o: Opts<E>) { if (o.alt !== undefined && el instanceof HTMLImageElement) el.alt = o.alt; if (typeof o?.class == "string") el.classList.add(o.class) if (typeof o?.class == "object") el.classList.add(...o.class) + if (o.role) el.role = o.role; if (o.aria_modal) el.ariaModal = "true" if (o.aria_popup) el.ariaHasPopup = o.aria_popup if (o.aria_label) el.ariaLabel = o.aria_label |