mirror of
https://github.com/docmost/docmost.git
synced 2026-05-21 09:14:07 +08:00
fix(a11y): WCAG 2.1 AA fixes (#2219)
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user