Skip to content

Commit

Permalink
fix(List): fix a regression in accessibility roles
Browse files Browse the repository at this point in the history
  • Loading branch information
alirezamirian committed Mar 16, 2024
1 parent 5fddba4 commit b7fe805
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
12 changes: 7 additions & 5 deletions packages/jui/src/List/StyledList.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import { css } from "styled-components";
import { styled } from "../styled";

export const StyledList = styled.div.withConfig<{
fillAvailableSpace?: boolean;
}>({
shouldForwardProp: (prop) => prop !== "fillAvailableSpace",
})`
export const StyledList = styled.div
.withConfig<{
fillAvailableSpace?: boolean;
}>({
shouldForwardProp: (prop) => prop !== "fillAvailableSpace",
})
.attrs({ role: "list" })`
padding: 0;
margin: 0;
list-style: none;
Expand Down
6 changes: 4 additions & 2 deletions packages/jui/src/List/StyledListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ export type StyledListItemProps = {
disabled: boolean;
};

export const StyledListItem = styled.div<StyledListItemProps>(
({ containerFocused, selected, disabled, theme }) => {
export const StyledListItem = styled.div.attrs({
role: "listitem",
})<StyledListItemProps>`
${({ containerFocused, selected, disabled, theme }) => {
let backgroundColor;
let color = disabled
? theme.color("*.disabledForeground")
Expand Down

0 comments on commit b7fe805

Please sign in to comment.