diff --git a/apps/webapp/app/components/primitives/Buttons.tsx b/apps/webapp/app/components/primitives/Buttons.tsx index 6859608eef..004dd4dad9 100644 --- a/apps/webapp/app/components/primitives/Buttons.tsx +++ b/apps/webapp/app/components/primitives/Buttons.tsx @@ -298,19 +298,17 @@ export const Button = forwardRef( const innerRef = useRef(null); useImperativeHandle(ref, () => innerRef.current as HTMLButtonElement); - if (props.shortcut) { - useShortcutKeys({ - shortcut: props.shortcut, - action: (e) => { - if (innerRef.current) { - innerRef.current.click(); - e.preventDefault(); - e.stopPropagation(); - } - }, - disabled, - }); - } + useShortcutKeys({ + shortcut: props.shortcut, + action: (e) => { + if (innerRef.current) { + innerRef.current.click(); + e.preventDefault(); + e.stopPropagation(); + } + }, + disabled: disabled || !props.shortcut, + }); return ( diff --git a/apps/webapp/app/routes/admin.orgs.tsx b/apps/webapp/app/routes/admin.orgs.tsx index bb59cebf31..afdcf5e97c 100644 --- a/apps/webapp/app/routes/admin.orgs.tsx +++ b/apps/webapp/app/routes/admin.orgs.tsx @@ -117,6 +117,11 @@ export default function AdminDashboardRoute() { to={`/@/orgs/${org.slug}`} className="mr-2" variant="tertiary/small" + shortcut={ + organizations.length === 1 + ? { modifiers: ["mod"], key: "enter", enabledOnInputElements: true } + : undefined + } > Impersonate