React HtmlEditor - Accessibility

Accessibility Features Overview

NOTE
The overall accessibility level of your application depends on the HTML Editor features you use.
Accessibility RequirementSupport Level
Right-to-Left Support
Keyboard Navigation Support
Screen Reader Support
Contrast Color Theme
Mobile Device Support
Lighthouse Accessibility Validation
Axe Accessibility Validation
WAVE Accessibility Validation
Section 508 Support
WCAG 2.x Support
  • - All component features meet the requirement
  • - Some component features may not meet the requirement
  • - Accessibility requirement is not supported

Accessibility Standards Compliance

The HTML Editor component meets a variety of Section 508 and WCAG 2.x compliance standards. Known exceptions:

Section 508 criteriaWCAG 2.x criteriaException description
501 (Web)(Software)
504.2 (Authoring Tool)
602.3 (Support Docs)
1.4.3 Contrast (Minimum) (Level AA)
1.4.11 Non-text Contrast (Level AA 2.1 and 2.2)
HTML Editor does not support Windows High Contrast themes.
501 (Web)(Software)
504.2 (Authoring Tool)
602.3 (Support Docs)
2.1.1 Keyboard (Level A)
11.5.2.12 Execution of available actions
Users cannot resize images, Popup, and Resizable controls within HTML Editor.
-4.1.2 Name, Role, ValueNVDA does not pronounce the state of the button in the toolbar (active or not).
504.2.2 PDF Export-If you export content from an HTML Editor to PDF, the following issues occur in the resulting document:
  • You cannot set header lines in exported tables.
  • Pictures are exported without "alt" attributes.
  • Pages and separate page parts do not have language settings.

The component also complies with the European Accessibility Act (EAA) and Americans with Disabilities Act (ADA) directives.

Keyboard Navigation

A user can use the following keys to interact with the HTML Editor component:

PCMacAction
Ctrl + C⌘ + CCopy
Ctrl + V⌘ + VPaste
Ctrl + Z⌘ + ZUndo
Ctrl + Y⌘ + YRedo
Ctrl + A⌘ + ASelect All
Ctrl + B⌘ + BBold
Ctrl + I⌘ + IItalic
EnterInsert a line break (a new paragraph)
Shift + EnterInsert a line break (in the same paragraph)
Tab
  • Indent list items
  • Focus the next cell in tables
  • Focus the next focusable element on the page. If keyboard.inlineTabInsertion is enabled, insert a tab character (\t) in the text.
Shift + Tab
  • Dedent list items
  • Focus the previous cell in tables
  • Focus one of the following elements:
    • The previous focusable element on the page
    • The HTML Editor toolbar (if configured)
    If text contains tab characters (\t) and keyboard.inlineTabInsertion is enabled, remove a tab character from the text.
Arrow Keys
  • Navigate through the table
  • Move focus between toolbar items (left and right arrow keys only).
Home
End
Move focus to the first/last item in the toolbar.
Ctrl + Shift + Up Arrow⌘ + Shift + Up ArrowFocus the previous focusable element on the page or the HTML Editor toolbar (if configured)
Ctrl + Shift + Down Arrow⌘ + Shift + Down ArrowFocus the next focusable element on the page
EnterMove the cursor outside the table (when in the last row)
EscClose active dialog
EnterApply active dialog data

Configure customizeModules to toggle keyboard.inlineTabInsertion:

App.tsx
  • import React, { useCallback } from 'react';
  • import { HtmlEditor } from 'devextreme-react/html-editor';
  •  
  • export default function App() {
  • const customizeQuillModules = useCallback((config) => {
  • config.keyboard.inlineTabInsertion = true;
  • }, []);
  •  
  • return (
  • <HtmlEditor
  • customizeModules={customizeQuillModules}
  • />
  • );
  • }

To navigate between toolbar items using the Tab key, disable allowKeyboardNavigation in HtmlEditor Toolbar instances. Call dxToolbar.defaultOptions() as follows:

App.tsx
  • import dxToolbar from "devextreme/ui/toolbar";
  • import { type ToolbarTypes } from "devextreme-react/toolbar";
  •  
  • dxToolbar.defaultOptions({
  • options: {
  • onInitialized(e: ToolbarTypes.InitializedEvent) {
  • if (e.element?.closest('.dx-htmleditor')) {
  • e.component?.option('allowKeyboardNavigation', false);
  • }
  • }
  • }
  • });

Replace .dx-htmleditor with a component ID or class to modify keyboard navigation behavior in a specific component only.

IMPORTANT
If you disable allowKeyboardNavigation, the DevExtreme Toolbar no longer follows the W3C ARIA APG Toolbar Pattern. Your application will be less accessible to users who rely on keyboard navigation.

Use the registerKeyHandler(key, handler) method to implement a custom handler for a key.

App.tsx
  • import React, { useRef, useEffect } from 'react';
  • import { HtmlEditor, type HtmlEditorRef } from 'devextreme-react/html-editor';
  •  
  • function App() {
  • const htmlEditorRef = useRef<HtmlEditorRef>(null);
  •  
  • useEffect(() => {
  • const htmlEditor = htmlEditorRef.current.instance();
  • htmlEditor.registerKeyHandler('backspace', function(e) {
  • // The argument "e" contains information about the event
  • });
  • htmlEditor.registerKeyHandler('space', function(e) {
  • // ...
  • });
  • }, []);
  •  
  • return (
  • <HtmlEditor ref={htmlEditorRef} />
  • );
  • }

Screen Reader Support

The HTML Editor component supports screen readers and complies to WAI-ARIA standards.