From 6bb00157bdec052e544b643a56709380faffd0b3 Mon Sep 17 00:00:00 2001 From: Adriana Babakanian Date: Wed, 24 May 2023 12:53:17 -0400 Subject: [PATCH 1/2] Remove aria-hidden=true from spans with required asterisk --- src/_InputLabel.tsx | 2 +- src/__tests__/deprecated/InputField.test.tsx | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/_InputLabel.tsx b/src/_InputLabel.tsx index ae1adbd4e1f..779aee82a81 100644 --- a/src/_InputLabel.tsx +++ b/src/_InputLabel.tsx @@ -55,7 +55,7 @@ const InputLabel: React.FC> = ({ {required ? ( {children} - + * ) : ( children diff --git a/src/__tests__/deprecated/InputField.test.tsx b/src/__tests__/deprecated/InputField.test.tsx index 71e8d6c0273..5a6fcae7cef 100644 --- a/src/__tests__/deprecated/InputField.test.tsx +++ b/src/__tests__/deprecated/InputField.test.tsx @@ -6,6 +6,7 @@ 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' @@ -66,7 +67,7 @@ describe('InputField', () => { , ) - const input = getByRole('textbox', {name: TEXTINPUTFIELD_LABEL_TEXT}) + const input = getByRole('textbox', {name: TEXTINPUTFIELD_LABEL_TEXT_WITH_ASTERISK}) expect(input.getAttribute('required')).not.toBeNull() }) From ddb6dfab24512f9d66b92d3c1a38584b0bda95b2 Mon Sep 17 00:00:00 2001 From: Adriana Babakanian Date: Thu, 25 May 2023 09:36:00 -0400 Subject: [PATCH 2/2] Create pink-beds-fetch.md --- .changeset/pink-beds-fetch.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/pink-beds-fetch.md diff --git a/.changeset/pink-beds-fetch.md b/.changeset/pink-beds-fetch.md new file mode 100644 index 00000000000..5400fd391fa --- /dev/null +++ b/.changeset/pink-beds-fetch.md @@ -0,0 +1,5 @@ +--- +'@primer/react': patch +--- + +Remove `aria-hidden=true` from `span`s with required asterisk