-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Desktop: Accessibility: Rich Text Editor: Make it possible to edit code blocks with a keyboard or touchscreen #11727
Conversation
See WCAG 2.2 SC 2.1.2 (and laurent22#10795). This commit adds a menu item to the desktop app that allows toggling tab indentation. Associated with this menu item is the standard [ctrl]-[m] keyboard shortcut.
…esktop/accessibility/rte-edit-code-right-click
// Katex is a special case with special opening/closing tags | ||
// and we don't currently handle switching the language in this case. | ||
disabled: source.language === 'katex', | ||
enabled: source.language !== 'katex', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed after replacing an any
type with a stronger type: disabled
was giving a type error.
}, | ||
{ | ||
type: 'textarea', | ||
name: 'codeTextArea', | ||
value: source.content, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed after replacing an any
type with a stronger type: value
was giving a type error. Removing value
does not prevent the edit dialog from opening with an existing code block's content.
…esktop/accessibility/rte-edit-code-right-click
…lity/rte-edit-code-right-click
Summary
Important
This pull request builds on the changes from #11717. Consider reviewing #11717 before this pull request.
This pull request does two related things:
Previously, it was necessary to double-click code blocks (with a mouse button) to edit them.
Related WCAG guideline: WCAG 2.2, SC 2.1.1: Keyboard.
See #10795.
This pull request supersedes #11723, which did not include automated tests and did not add "Edit" to the context menu.
Related (unresolved) tasks
Testing
Automated tests
New tests: Verify that existing functionality isn't broken — that 1) new code blocks can be created from the toolbar and 2) existing code blocks can be edited by double-clicking.
Manual testing
Verified that (on Ubuntu 24.04):