fix(a11y): WCAG 2.1 AA fixes

This commit is contained in:
Philipinho
2026-05-20 14:47:04 +01:00
parent 6cf8101ab3
commit a8c0033ebb
119 changed files with 1064 additions and 202 deletions
+6 -4
View File
@@ -120,15 +120,17 @@ export const Indent = Extension.create<IndentOptions>({
};
return {
// Return the command's result so Tab falls through to the browser
// (moving focus out of the editor) once the user has reached max
// indent. Without this Tab stays trapped at max depth, failing
// WCAG 2.1.2.
Tab: () => {
if (!isInIndentableBlock()) return false;
this.editor.commands.indent();
return true;
return this.editor.commands.indent();
},
'Shift-Tab': () => {
if (!isInIndentableBlock()) return false;
this.editor.commands.outdent();
return true;
return this.editor.commands.outdent();
},
Backspace: () => {
const { $from, empty } = this.editor.state.selection;