Commit 89534ba 1 parent dc289ea commit 89534ba Copy full SHA for 89534ba
File tree 1 file changed +1
-9
lines changed
packages/block-library/src/navigation-link
1 file changed +1
-9
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,6 @@ import {
15
15
ToolbarButton ,
16
16
Tooltip ,
17
17
ToolbarGroup ,
18
- KeyboardShortcuts ,
19
18
} from '@wordpress/components' ;
20
19
import { displayShortcut , isKeyboardEvent , ENTER } from '@wordpress/keycodes' ;
21
20
import { __ } from '@wordpress/i18n' ;
@@ -340,7 +339,7 @@ export default function NavigationLinkEdit( {
340
339
function onKeyDown ( event ) {
341
340
if (
342
341
isKeyboardEvent . primary ( event , 'k' ) ||
343
- ( ! url && event . keyCode === ENTER )
342
+ ( ( ! url || isDraft || isInvalid ) && event . keyCode === ENTER )
344
343
) {
345
344
setIsLinkOpen ( true ) ;
346
345
}
@@ -553,13 +552,6 @@ export default function NavigationLinkEdit( {
553
552
) }
554
553
{ ( isInvalid || isDraft ) && (
555
554
< div className = "wp-block-navigation-link__placeholder-text wp-block-navigation-link__label" >
556
- < KeyboardShortcuts
557
- shortcuts = { {
558
- enter : ( ) =>
559
- isSelected &&
560
- setIsLinkOpen ( true ) ,
561
- } }
562
- />
563
555
< Tooltip
564
556
position = "top center"
565
557
text = { tooltipText }
You can’t perform that action at this time.
0 commit comments