Skip to content

Commit

Permalink
Revert "Remove aria-hidden=true from spans with required asterisk (#3320
Browse files Browse the repository at this point in the history
) (#3439)" (#3465)

This reverts commit 5b0f6b5.
  • Loading branch information
broccolinisoup authored Jul 3, 2023
1 parent 5097a1b commit c5bd228
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 8 deletions.
5 changes: 0 additions & 5 deletions .changeset/pink-beds-fetch.md

This file was deleted.

3 changes: 1 addition & 2 deletions src/__tests__/deprecated/InputField.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import InputField from '../../deprecated/InputField'
expect.extend(toHaveNoViolations)

const TEXTINPUTFIELD_LABEL_TEXT = 'Name'
const TEXTINPUTFIELD_LABEL_TEXT_WITH_ASTERISK = 'Name *'
const TEXTINPUTFIELD_CAPTION_TEXT = 'Hint: your first name'
const TEXTINPUTFIELD_SUCCESS_TEXT = 'This name is valid'
const TEXTINPUTFIELD_ERROR_TEXT = 'This name is invalid'
Expand Down Expand Up @@ -67,7 +66,7 @@ describe('InputField', () => {
</SSRProvider>,
)

const input = getByRole('textbox', {name: TEXTINPUTFIELD_LABEL_TEXT_WITH_ASTERISK})
const input = getByRole('textbox', {name: TEXTINPUTFIELD_LABEL_TEXT})

expect(input.getAttribute('required')).not.toBeNull()
})
Expand Down
2 changes: 1 addition & 1 deletion src/internal/components/InputLabel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const InputLabel: React.FC<React.PropsWithChildren<Props>> = ({
{required ? (
<Box display="flex" as="span">
<Box mr={1}>{children}</Box>
<span>*</span>
<span aria-hidden="true">*</span>
</Box>
) : (
children
Expand Down

0 comments on commit c5bd228

Please sign in to comment.