File tree Expand file tree Collapse file tree 2 files changed +15
-10
lines changed Expand file tree Collapse file tree 2 files changed +15
-10
lines changed Original file line number Diff line number Diff line change @@ -343,16 +343,16 @@ export const LinkButton = ({
343
343
...props
344
344
} : LinkPropsType ) => {
345
345
const innerRef = useRef < HTMLAnchorElement > ( null ) ;
346
- if ( props . shortcut ) {
347
- useShortcutKeys ( {
348
- shortcut : props . shortcut ,
349
- action : ( ) => {
350
- if ( innerRef . current ) {
351
- innerRef . current . click ( ) ;
352
- }
353
- } ,
354
- } ) ;
355
- }
346
+
347
+ useShortcutKeys ( {
348
+ shortcut : props . shortcut ,
349
+ action : ( ) => {
350
+ if ( innerRef . current ) {
351
+ innerRef . current . click ( ) ;
352
+ }
353
+ } ,
354
+ disabled : disabled || ! props . shortcut ,
355
+ } ) ;
356
356
357
357
if ( disabled ) {
358
358
return (
Original file line number Diff line number Diff line change @@ -117,6 +117,11 @@ export default function AdminDashboardRoute() {
117
117
to = { `/@/orgs/${ org . slug } ` }
118
118
className = "mr-2"
119
119
variant = "tertiary/small"
120
+ shortcut = {
121
+ organizations . length === 1
122
+ ? { modifiers : [ "mod" ] , key : "enter" , enabledOnInputElements : true }
123
+ : undefined
124
+ }
120
125
>
121
126
Impersonate
122
127
</ LinkButton >
You can’t perform that action at this time.
0 commit comments