move tabindex setting to modal controls

This commit is contained in:
2026-05-14 08:45:31 -07:00
parent c4b7faca88
commit 4f0a0f3969
2 changed files with 3 additions and 1 deletions

View File

@ -4,6 +4,8 @@ if (window.innerWidth > 650) {
const closeButton = document.querySelector(".close-dialog");
const hero = document.querySelector(".hero");
hero.tabIndex = 0;
hero.addEventListener("click", (e) => dialog.showModal());
hero.addEventListener("keydown", (e) => {
if (e.key === "Enter" || e.key === " ") {