File tree Expand file tree Collapse file tree 3 files changed +22
-0
lines changed
Expand file tree Collapse file tree 3 files changed +22
-0
lines changed Original file line number Diff line number Diff line change 266266 tick ().then (() => focusItem (newId))
267267 }
268268
269+ if (event .shiftKey && event .key === ' Enter' && ! event .target .closest (' [contenteditable]' )) {
270+ if ($zoomedItemId) {
271+ event .preventDefault ()
272+ focusDescription ($zoomedItemId)
273+ return
274+ }
275+ }
276+
269277 if ((event .metaKey || event .ctrlKey ) && event .key === ' z' ) {
270278 if (event .shiftKey ) {
271279 event .preventDefault ()
Original file line number Diff line number Diff line change @@ -115,6 +115,11 @@ export function getExtensions({
115115 } ,
116116 onShiftArrowDown : ( ) => {
117117 dispatch ( 'shiftselectdown' )
118+ } ,
119+ onEscape : ( ) => {
120+ if ( isDescription ) {
121+ dispatch ( 'exitdescription' )
122+ }
118123 }
119124 } ) ,
120125 CheckboxExtension . configure ( {
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ export const KeyboardExtension = Extension.create({
1616 onArrowDown : null ,
1717 onShiftArrowUp : null ,
1818 onShiftArrowDown : null ,
19+ onEscape : null ,
1920 isDescription : false ,
2021 isZoomedRootDescription : false
2122 }
@@ -155,6 +156,14 @@ export const KeyboardExtension = Extension.create({
155156 return true
156157 }
157158 return false
159+ } ,
160+
161+ 'Escape' : ( ) => {
162+ if ( this . options . isDescription && this . options . onEscape ) {
163+ this . options . onEscape ( )
164+ return true
165+ }
166+ return false
158167 }
159168 }
160169 }
You can’t perform that action at this time.
0 commit comments