diff --git a/app/javascript/trixeditorpatch.js b/app/javascript/trixeditorpatch.js new file mode 100644 index 00000000..596c8148 --- /dev/null +++ b/app/javascript/trixeditorpatch.js @@ -0,0 +1,294 @@ +/* Trix A11Y Patch v3 (WCAG 2.1 AA) + - Hit area fix (pseudo-elements can't steal clicks) + - Roving tabindex (Tab enters/leaves, Arrows move, Home/End jump) + - Robust keyboard activation (synth pointer+mouse+click) + - aria-pressed/aria-disabled sync; toolbar/dialog/editor semantics +*/ +(function trixA11yV3(){ + if (window.__trixA11yV3Applied) return; + window.__trixA11yV3Applied = true; + + // ---------- Inject CSS ---------- + const STYLE_ID = 'trix-a11y-v3-styles'; + if (!document.getElementById(STYLE_ID)) { + const s = document.createElement('style'); + s.id = STYLE_ID; + s.textContent = ` + /* Make the actual