Why Accessibility Matters for WYSIWYG Editors
A WYSIWYG editor that is not accessible locks out users who rely on keyboards, screen readers, or high contrast modes. WCAG 2.1 AA compliance is increasingly required for government and enterprise projects. A rich text editor sits at the heart of many content creation workflows — making it accessible benefits every user, not just those with disabilities.
Accessible WYSIWYG editors are rare. Most editors treat accessibility as an afterthought. RayEditor was built with keyboard navigation and ARIA semantics from the start.
ARIA Implementation in RayEditor
Toolbar
<!-- RayEditor renders the toolbar like this -->
<div role="toolbar" aria-label="Text formatting" aria-orientation="horizontal">
<button
role="button"
aria-label="Bold"
aria-pressed="false"
title="Bold (Ctrl+B)"
>...</button>
<button
role="button"
aria-label="Italic"
aria-pressed="true" <!-- updates when active -->
title="Italic (Ctrl+I)"
>...</button>
</div>
Editor Content Area
<div
role="textbox"
aria-multiline="true"
aria-label="Rich text editor"
contenteditable="true"
aria-placeholder="Start typing..."
></div>
Keyboard Navigation Reference
| Key | Action |
|---|---|
| Tab | Move focus from content area to toolbar |
| ← / → | Navigate between toolbar buttons |
| Enter / Space | Activate focused toolbar button |
| Escape | Close open modal/dropdown, return focus to editor |
| Ctrl+B | Bold |
| Ctrl+I | Italic |
| Ctrl+U | Underline |
| Ctrl+K | Insert/edit link |
| Ctrl+F | Find & Replace |
| Ctrl+Z | Undo |
| Ctrl+Y | Redo |
| / (blank line) | Open slash command palette |
Modal Focus Traps
All RayEditor modals — link insertion, image upload, find & replace — implement focus trapping. When a modal opens, focus moves to the first interactive element inside. Tab cycles through modal controls only. Escape dismisses the modal and restores focus to the editor.
// RayEditor dispatches accessibility events you can hook into
editor.on('modal:open', ({ id }) => {
console.log('Modal opened:', id); // 'link', 'image', 'find-replace'
});
editor.on('modal:close', ({ id }) => {
console.log('Modal closed:', id);
});
WCAG 2.1 AA Checklist for RayEditor
| Criterion | Status | Implementation |
|---|---|---|
| 1.3.1 Info and Relationships | ✓ | Semantic HTML headings, lists, tables in content |
| 1.4.3 Contrast (Minimum) | ✓ | 4.5:1 ratio on all text in both light and dark themes |
| 2.1.1 Keyboard | ✓ | Full keyboard navigation, all actions reachable |
| 2.1.2 No Keyboard Trap | ✓ | Escape always dismisses modals and returns focus |
| 2.4.3 Focus Order | ✓ | Logical tab order: editor → toolbar → modal |
| 2.4.7 Focus Visible | ✓ | Visible focus ring on all interactive elements |
| 4.1.2 Name, Role, Value | ✓ | role, aria-label, aria-pressed on all toolbar buttons |
Screen Reader Tips
- RayEditor announces toolbar button state changes via
aria-pressedlive updates. - The content area uses
role="textbox" aria-multiline="true"— compatible with NVDA, JAWS, and VoiceOver. - Modals use
role="dialog"witharia-labelledbypointing to the modal title. - Slash command palette uses
role="listbox"witharia-activedescendantfor navigation announcements.
Conclusion
RayEditor is one of the few WYSIWYG editors that implements ARIA semantics, keyboard navigation, and modal focus traps correctly. For projects that require WCAG 2.1 AA compliance or serve users with accessibility needs, RayEditor provides a solid foundation without additional cost or configuration.