diff --git a/changes/issue-26505-keyboard-accssibility-to-activites b/changes/issue-26505-keyboard-accssibility-to-activites new file mode 100644 index 0000000000..d028308ba5 --- /dev/null +++ b/changes/issue-26505-keyboard-accssibility-to-activites @@ -0,0 +1 @@ +- add keyboard accessibility controls to activities on dashboard and host details pages diff --git a/frontend/components/ActivityItem/ActivityItem.tsx b/frontend/components/ActivityItem/ActivityItem.tsx index 34df4fadc0..6c9656baef 100644 --- a/frontend/components/ActivityItem/ActivityItem.tsx +++ b/frontend/components/ActivityItem/ActivityItem.tsx @@ -113,7 +113,10 @@ const ActivityItem = ({ [`${baseClass}__no-details`]: hideShowDetails, }); - const onShowActivityDetails = () => { + const onShowActivityDetails = (e: React.MouseEvent) => { + // added this stopPropagation to as there is some weirdness around the event + // bubbling up and calling the Modals onEnter handler. + e.stopPropagation(); onShowDetails({ type: activity.type, details: activity.details }); }; @@ -137,7 +140,8 @@ const ActivityItem = ({ />
-
@@ -168,12 +172,17 @@ const ActivityItem = ({
{!hideShowDetails && ( - )} {!hideCancel && (
- + ); }; diff --git a/frontend/components/ActivityItem/_styles.scss b/frontend/components/ActivityItem/_styles.scss index 9ec63722c3..ddabcd25f5 100644 --- a/frontend/components/ActivityItem/_styles.scss +++ b/frontend/components/ActivityItem/_styles.scss @@ -36,6 +36,7 @@ } &__details-wrapper { + all: unset; // reset of all browser default button styles. display: flex; gap: $pad-medium; justify-content: space-between; @@ -45,6 +46,20 @@ padding: $pad-small; margin-bottom: $pad-large; + &:focus { + outline: 2px solid $ui-vibrant-blue-25; + } + + &:hover, &:focus, &:focus-within { + border-radius: $border-radius-large; + background-color: $ui-off-white; + cursor: pointer; + + .activity-item__action-button { + visibility: visible; + } + } + .premium-icon-tip { position: relative; top: 4px; @@ -56,16 +71,6 @@ line-height: 16px; } - &:hover { - border-radius: $border-radius-large; - background-color: $ui-off-white; - cursor: pointer; - - .activity-item__details-actions { - visibility: visible; - } - } - .button { height: 16px; @@ -76,11 +81,15 @@ } &__details-actions { - visibility: hidden; display: flex; gap: $pad-medium; } + &__action-button { + visibility: hidden; + } + + &__close-icon { cursor: pointer; &:hover {