|
|
|
@@ -18,6 +18,7 @@ export const createAccordion = |
|
|
|
} |
|
|
|
|
|
|
|
const ul = createElement('ul', type === 'regular' ? ['linklist'] : [], null, accordion); |
|
|
|
ul.role = "tablist"; |
|
|
|
|
|
|
|
if (type === 'regular') { |
|
|
|
items.map((item) => { |
|
|
|
@@ -25,13 +26,16 @@ export const createAccordion = |
|
|
|
const a = createElement('a', ['accordion-toggler'], item.title, li); |
|
|
|
const content = createElement('div', ['accordion-content'], item.content, li); |
|
|
|
|
|
|
|
// a.href = '#' + item.id; |
|
|
|
a.href = '#' + item.id; |
|
|
|
a.role = 'tab'; |
|
|
|
a.role = 'button'; |
|
|
|
a.setAttribute('aria-controls', item.id); |
|
|
|
a.ariaExpanded = false; |
|
|
|
|
|
|
|
content.id = item.id; |
|
|
|
content.role = 'tabpanel'; |
|
|
|
content.ariaHidden = true; |
|
|
|
content.ariaExpanded = false; |
|
|
|
content.setAttribute('aria-labelledby', item.id); |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
|