File tree Expand file tree Collapse file tree
docs/content.en/docs/release-notes Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -38,6 +38,7 @@ Information about release notes of Coco Server is provided here.
3838- fix: panic caused by "state() called before manage()" #806
3939- fix: fix multiline input issue #808
4040- fix: fix ctrl+k not working #815
41+ - fix: fix enter key on subpages #819
4142
4243### ✈️ Improvements
4344
Original file line number Diff line number Diff line change @@ -226,19 +226,29 @@ const ContextMenu = ({ formatUrl }: ContextMenuProps) => {
226226 }
227227 } ) ;
228228
229- useOSKeyPress ( shortcuts , ( _ , key ) => {
230- if ( ! visibleContextMenu ) return ;
231-
232- let matched ;
233-
234- if ( key === "enter" ) {
235- matched = searchMenus . find ( ( _ , index ) => index === state . activeMenuIndex ) ;
236- } else {
237- matched = searchMenus . find ( ( item ) => item . shortcut === key ) ;
229+ useOSKeyPress (
230+ shortcuts ,
231+ ( event , key ) => {
232+ if ( ! visibleContextMenu ) return ;
233+
234+ event . stopPropagation ( ) ;
235+
236+ let matched ;
237+
238+ if ( key === "enter" ) {
239+ matched = searchMenus . find ( ( _ , index ) => {
240+ return index === state . activeMenuIndex ;
241+ } ) ;
242+ } else {
243+ matched = searchMenus . find ( ( item ) => item . shortcut === key ) ;
244+ }
245+
246+ handleClick ( matched ?. clickEvent ) ;
247+ } ,
248+ {
249+ target : document . body ,
238250 }
239-
240- handleClick ( matched ?. clickEvent ) ;
241- } ) ;
251+ ) ;
242252
243253 useEffect ( ( ) => {
244254 setOpenPopover ( visibleContextMenu ) ;
You can’t perform that action at this time.
0 commit comments