From: Alexander Wilms Date: Thu, 26 Jun 2025 22:32:58 +0000 (+0200) Subject: feat(mermaid-viewer): Add accessibility attributes to buttons X-Git-Url: http://source.bookstackapp.com/hacks/commitdiff_plain/d2af95af25e154d458109a13c5b21570bf9f1c6a feat(mermaid-viewer): Add accessibility attributes to buttons Adds role and tabindex attributes to mermaid viewer buttons for improved accessibility. --- diff --git a/content/mermaid-viewer/head.html b/content/mermaid-viewer/head.html index 8e7afe0..0f76bfd 100644 --- a/content/mermaid-viewer/head.html +++ b/content/mermaid-viewer/head.html @@ -101,6 +101,8 @@ setupViewer() { const createButton = (title, iconClass, ...extraClasses) => { const button = document.createElement('div'); + button.setAttribute('role', 'button'); + button.setAttribute('tabindex', '0'); button.className = `${CSS_CLASSES.BUTTON_BASE} ${extraClasses.join(' ')}`; button.title = title; const icon = document.createElement('i');