add accessibility to open and close buttons (#311)

refactor the way to focus apps when the menu is opened (#301)
This commit is contained in:
Simon Vieille
2024-02-14 12:12:08 +01:00
parent b8aa312a14
commit 951dd742d8
6 changed files with 38 additions and 29 deletions
+7 -1
View File
@@ -3,7 +3,13 @@ module.exports = (tagName, attributes) => {
if (typeof attributes === 'object') {
for (let i in attributes) {
element.setAttribute(i, attributes[i])
if (i === 'text') {
element.textContent = attributes[i]
} else if (i === 'html') {
element.innerHTML = attributes[i]
} else {
element.setAttribute(i, attributes[i])
}
}
}