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 = ({
343343 ...props
344344} : LinkPropsType ) => {
345345 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+ } ) ;
356356
357357 if ( disabled ) {
358358 return (
Original file line number Diff line number Diff line change @@ -117,6 +117,11 @@ export default function AdminDashboardRoute() {
117117 to = { `/@/orgs/${ org . slug } ` }
118118 className = "mr-2"
119119 variant = "tertiary/small"
120+ shortcut = {
121+ organizations . length === 1
122+ ? { modifiers : [ "mod" ] , key : "enter" , enabledOnInputElements : true }
123+ : undefined
124+ }
120125 >
121126 Impersonate
122127 </ LinkButton >
You can’t perform that action at this time.
0 commit comments