-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(CheckboxRadioBase): Resolve 'nested-interactive' axe v4 error
This resolves the following error: https://dequeuniversity.com/rules/axe/4.4/nested-interactive This was occurring as we effectively had a checkbox within a checkbox, as we had a visually-hidden `<input>` contained within an element with `role="checkbox"`. The removes the roles from the parent elements. A further problem was that the 0px <input> caused a screen reader used with Firefox to behave oddly. This reorganises things slightly so that it has the same dimensions as`StyledCheckmark`.
- Loading branch information
Showing
9 changed files
with
66 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
packages/react-component-library/src/components/Checkbox/partials/StyledCheckmarkWrapper.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import styled from 'styled-components' | ||
|
||
import { CheckmarkWrapperProps } from '../../CheckboxRadioBase' | ||
|
||
export const StyledCheckmarkWrapper = styled.span<CheckmarkWrapperProps>` | ||
display: block; | ||
position: absolute; | ||
top: ${({ $hasContainer }) => ($hasContainer ? '12px' : '4px')}; | ||
left: ${({ $hasContainer }) => ($hasContainer ? '12px' : '4px')}; | ||
height: 18px; | ||
width: 18px; | ||
` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
packages/react-component-library/src/components/Radio/partials/StyledCheckmarkWrapper.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import styled from 'styled-components' | ||
|
||
import { CheckmarkWrapperProps } from '../../CheckboxRadioBase' | ||
|
||
export const StyledCheckmarkWrapper = styled.span<CheckmarkWrapperProps>` | ||
display: block; | ||
position: absolute; | ||
top: ${({ $hasContainer }) => ($hasContainer ? '13px' : '4px')}; | ||
left: ${({ $hasContainer }) => ($hasContainer ? '12px' : '4px')}; | ||
height: 16px; | ||
width: 16px; | ||
` |