diff --git a/stylesheets/components/LeftPaneDialog.scss b/stylesheets/components/LeftPaneDialog.scss index 0bc0fd21cc..594a9034e8 100644 --- a/stylesheets/components/LeftPaneDialog.scss +++ b/stylesheets/components/LeftPaneDialog.scss @@ -11,8 +11,6 @@ } .LeftPaneDialog { - @include button-reset; - align-items: center; background: $color-ultramarine; color: $color-white; @@ -23,6 +21,10 @@ user-select: none; cursor: inherit; + &--clickable { + cursor: pointer; + } + &__container { display: flex; align-items: center; diff --git a/ts/components/LeftPaneDialog.tsx b/ts/components/LeftPaneDialog.tsx index 15458b8a28..662951b4ee 100644 --- a/ts/components/LeftPaneDialog.tsx +++ b/ts/components/LeftPaneDialog.tsx @@ -59,6 +59,17 @@ export const LeftPaneDialog: React.FC = ({ onClick?.(); }; + const onKeyDownWrap = (e: React.KeyboardEvent) => { + if (e.key !== 'Enter' && e.key !== ' ') { + return; + } + + e.preventDefault(); + e.stopPropagation(); + + onClick?.(); + }; + const onCloseWrap = (e: React.MouseEvent) => { e.preventDefault(); e.stopPropagation(); @@ -109,6 +120,7 @@ export const LeftPaneDialog: React.FC = ({ const className = classNames([ BASE_CLASS_NAME, type === undefined ? undefined : `${BASE_CLASS_NAME}--${type}`, + onClick === undefined ? undefined : `${BASE_CLASS_NAME}--clickable`, ]); const content = ( @@ -128,16 +140,17 @@ export const LeftPaneDialog: React.FC = ({ if (onClick) { return ( - + ); }