Skip to content

Commit

Permalink
Add widget ESC shortuct accessibility dialog entry (#16310)
Browse files Browse the repository at this point in the history
Other (widget): Added information to the Accessibility help dialog about a keyboard shortcut that moves focus from a nested editable back to the widget.

---------

Co-authored-by: Aleksander Nowodzinski <a.nowodzinski@cksource.com>
  • Loading branch information
Mati365 and oleq committed May 8, 2024
1 parent c0c1fcc commit 8193f02
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/ckeditor5-widget/lang/contexts.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@
"Insert a new paragraph directly after a widget": "Accessibility help dialog entry explaining the meaning of the keystroke that inserts a paragraph after a widget.",
"Insert a new paragraph directly before a widget": "Accessibility help dialog entry explaining the meaning of the keystroke that inserts a paragraph before a widget.",
"Move the caret to allow typing directly before a widget": "Accessibility help dialog entry explaining the meaning of the keystroke that moves the caret before a widget.",
"Move the caret to allow typing directly after a widget": "Accessibility help dialog entry explaining the meaning of the keystroke that moves the caret after a widget."
"Move the caret to allow typing directly after a widget": "Accessibility help dialog entry explaining the meaning of the keystroke that moves the caret after a widget.",
"Move focus from an editable area back to the parent widget": "Accessibility help dialog entry explaining the meaning of the keystroke that moves selection from a nested editable area back to the parent widget."
}
4 changes: 4 additions & 0 deletions packages/ckeditor5-widget/src/widget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,10 @@ export default class Widget extends Plugin {
id: 'widget',
label: t( 'Keystrokes that can be used when a widget is selected (for example: image, table, etc.)' ),
keystrokes: [
{
label: t( 'Move focus from an editable area back to the parent widget' ),
keystroke: 'Esc'
},
{
label: t( 'Insert a new paragraph directly after a widget' ),
keystroke: 'Enter'
Expand Down
5 changes: 5 additions & 0 deletions packages/ckeditor5-widget/tests/widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,11 @@ describe( 'Widget', () => {
'Keystrokes that can be used when a widget is selected (for example: image, table, etc.)'
);

expect( editor.accessibility.keystrokeInfos.get( 'contentEditing' ).groups.get( 'widget' ).keystrokes ).to.deep.include( {
label: 'Move focus from an editable area back to the parent widget',
keystroke: 'Esc'
} );

expect( editor.accessibility.keystrokeInfos.get( 'contentEditing' ).groups.get( 'widget' ).keystrokes ).to.deep.include( {
label: 'Insert a new paragraph directly after a widget',
keystroke: 'Enter'
Expand Down

0 comments on commit 8193f02

Please sign in to comment.