Skip to content

fix: Use inset border for highlighting selected items in select and multiselect #3486

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 15, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 21 additions & 8 deletions src/internal/components/selectable-item/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,12 @@
border-color: awsui.$color-border-dropdown-item-dimmed-hover;
background-color: awsui.$color-background-dropdown-item-dimmed;
}
&.is-keyboard {
border-color: awsui.$color-border-dropdown-item-focused;
&:not(.visual-refresh) {
box-shadow: inset 0 0 0 awsui.$border-control-focus-ring-shadow-spread awsui.$color-border-item-focused;
}
}
Comment on lines +71 to +76
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just moved this chunk up from below because it made more logical sense here.

}

&.selected {
Expand All @@ -80,8 +86,22 @@
border-end-end-radius: 0;
}
&.highlighted {
border-color: awsui.$color-border-dropdown-item-hover;
border-color: awsui.$color-border-dropdown-item-selected;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The hover/focus styling inside a selected item is displayed using an outline. So the border-color should remain the selected color.

z-index: 3;
outline: awsui.$border-item-width solid awsui.$color-border-dropdown-item-hover;
outline-offset: calc(-2 * #{awsui.$border-item-width});
&.is-keyboard {
border-color: awsui.$color-border-dropdown-item-selected;
outline-color: awsui.$color-border-dropdown-item-focused;
}

&:not(.visual-refresh) {
border-color: awsui.$color-border-dropdown-item-hover;
outline: none;
&.is-keyboard {
border-color: awsui.$color-border-dropdown-item-focused;
}
}
}
}

Expand All @@ -90,13 +110,6 @@
border-start-end-radius: 0;
}

&.highlighted.is-keyboard {
border-color: awsui.$color-border-dropdown-item-focused;
&:not(.visual-refresh) {
box-shadow: inset 0 0 0 awsui.$border-control-focus-ring-shadow-spread awsui.$color-border-item-focused;
}
}

&.parent {
font-weight: bold;
color: awsui.$color-text-dropdown-group-label;
Expand Down
Loading