File tree Expand file tree Collapse file tree 2 files changed +8
-9
lines changed
src/frontend/apps/impress/src/features/docs/doc-editor/components Expand file tree Collapse file tree 2 files changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ and this project adheres to
2121- 🌐(backend) internationalize demo #1644
2222- ♿(frontend) improve accessibility:
2323 - ♿️Improve keyboard accessibility for the document tree #1681
24- - ♿️(frontend) fix subdoc opening and emoji pick focus
24+ - ♿️(frontend) fix subdoc opening and emoji pick focus # 1745
2525
2626### Fixed
2727
Original file line number Diff line number Diff line change @@ -20,20 +20,19 @@ export const EmojiPicker = ({
2020} : EmojiPickerProps ) => {
2121 const { i18n } = useTranslation ( ) ;
2222
23- // Close picker with Escape key for keyboard users
23+ // Handle Escape key to close the picker
2424 useEffect ( ( ) => {
25- const handleKeyDown = ( event : KeyboardEvent ) => {
26- if ( event . key === 'Escape' ) {
27- event . stopPropagation ( ) ;
28- event . preventDefault ( ) ;
25+ const handleEscape = ( e : KeyboardEvent ) => {
26+ if ( e . key === 'Escape' ) {
27+ e . preventDefault ( ) ;
28+ e . stopPropagation ( ) ;
2929 onClickOutside ( ) ;
3030 }
3131 } ;
3232
33- window . addEventListener ( 'keydown' , handleKeyDown , true ) ;
34-
33+ document . addEventListener ( 'keydown' , handleEscape , true ) ;
3534 return ( ) => {
36- window . removeEventListener ( 'keydown' , handleKeyDown , true ) ;
35+ document . removeEventListener ( 'keydown' , handleEscape , true ) ;
3736 } ;
3837 } , [ onClickOutside ] ) ;
3938
You can’t perform that action at this time.
0 commit comments