From a18434f7706fb65a8183e239497eb017cc495a48 Mon Sep 17 00:00:00 2001 From: Sarah Higley Date: Fri, 17 Feb 2023 15:08:44 -0800 Subject: [PATCH 1/4] fix: update role and accname for non-hidden icon button --- .../react/src/components/ComboBox/ComboBox.test.tsx | 10 +++++----- packages/react/src/components/ComboBox/ComboBox.tsx | 10 +++++++--- .../ComboBox/__snapshots__/ComboBox.test.tsx.snap | 4 ---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/react/src/components/ComboBox/ComboBox.test.tsx b/packages/react/src/components/ComboBox/ComboBox.test.tsx index 2d6d29734a30a3..6356b5153c09df 100644 --- a/packages/react/src/components/ComboBox/ComboBox.test.tsx +++ b/packages/react/src/components/ComboBox/ComboBox.test.tsx @@ -221,7 +221,7 @@ describe('ComboBox', () => { const combobox = getByRole('combobox'); userEvent.type(combobox, 'f{enter}'); - const caretdownButton = getByRole('presentation', { hidden: true }); + const caretdownButton = getByRole('button'); userEvent.click(caretdownButton); expect(getAllByRole('option')).toHaveLength(DEFAULT_OPTIONS.length); @@ -233,7 +233,7 @@ describe('ComboBox', () => { const combobox = getByRole('combobox'); userEvent.type(combobox, 'f{enter}'); - const caretdownButton = getByRole('presentation', { hidden: true }); + const caretdownButton = getByRole('button'); userEvent.click(caretdownButton); const options = getAllByRole('option'); @@ -555,7 +555,7 @@ describe('ComboBox', () => { const { getByRole, queryAllByRole } = render( , ); - const caretdownButton = getByRole('presentation', { hidden: true }); + const caretdownButton = getByRole('button'); userEvent.click(caretdownButton); expect(queryAllByRole('option')).toHaveLength(0); }); @@ -1189,7 +1189,7 @@ describe('ComboBox', () => { , ); const combobox = getByRole('combobox'); - const caretdownButton = getByRole('presentation', { hidden: true }); + const caretdownButton = getByRole('button'); userEvent.type(combobox, comboBoxOption.text); //click on container to trigger onBlur userEvent.click(container); @@ -1215,7 +1215,7 @@ describe('ComboBox', () => { const { container, getByRole, getAllByRole } = render(); const combobox = getByRole('combobox'); - const caretdownButton = getByRole('presentation', { hidden: true }); + const caretdownButton = getByRole('button'); userEvent.type(combobox, comboBoxOption.text); userEvent.click(container); expect(combobox.getAttribute('value')).toEqual(comboBoxOption.text); diff --git a/packages/react/src/components/ComboBox/ComboBox.tsx b/packages/react/src/components/ComboBox/ComboBox.tsx index 42a842b9ce4f4a..0fd7625ce73e1a 100644 --- a/packages/react/src/components/ComboBox/ComboBox.tsx +++ b/packages/react/src/components/ComboBox/ComboBox.tsx @@ -591,6 +591,10 @@ class ComboBoxInternal extends React.Component @@ -609,7 +608,6 @@ exports[`ComboBox Renders correctly when open 1`] = ` forced-color-adjust: none; } data-is-focusable="false" - role="presentation" tabindex="-1" type="button" > @@ -1377,7 +1375,6 @@ exports[`ComboBox Renders correctly when opened in multi-select mode 1`] = ` forced-color-adjust: none; } data-is-focusable="false" - role="presentation" tabindex="-1" type="button" > @@ -2284,7 +2281,6 @@ exports[`ComboBox renders with a Keytip correctly 1`] = ` forced-color-adjust: none; } data-is-focusable="false" - role="presentation" tabindex="-1" type="button" > From 0963cf52810763cabda282881a8da9b33eb6f714 Mon Sep 17 00:00:00 2001 From: Sarah Higley Date: Fri, 17 Feb 2023 15:11:11 -0800 Subject: [PATCH 2/4] change file --- ...luentui-react-f3d82f9f-d152-455c-914e-71cf2dfe554b.json | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 change/@fluentui-react-f3d82f9f-d152-455c-914e-71cf2dfe554b.json diff --git a/change/@fluentui-react-f3d82f9f-d152-455c-914e-71cf2dfe554b.json b/change/@fluentui-react-f3d82f9f-d152-455c-914e-71cf2dfe554b.json new file mode 100644 index 00000000000000..53c2b214348b58 --- /dev/null +++ b/change/@fluentui-react-f3d82f9f-d152-455c-914e-71cf2dfe554b.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "fix: update role and accname for non-hidden icon button", + "packageName": "@fluentui/react", + "email": "sarah.higley@microsoft.com", + "dependentChangeType": "patch" +} From 8e5cb3e0411d6baa9edeb0f4f7e1321b44b40ef2 Mon Sep 17 00:00:00 2001 From: Sarah Higley Date: Tue, 21 Feb 2023 10:16:25 -0800 Subject: [PATCH 3/4] use undefined instead of creating an object Co-authored-by: Sean Monahan --- packages/react/src/components/ComboBox/ComboBox.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react/src/components/ComboBox/ComboBox.tsx b/packages/react/src/components/ComboBox/ComboBox.tsx index 0fd7625ce73e1a..39813c94f78bed 100644 --- a/packages/react/src/components/ComboBox/ComboBox.tsx +++ b/packages/react/src/components/ComboBox/ComboBox.tsx @@ -648,7 +648,7 @@ class ComboBoxInternal extends React.Component Date: Tue, 21 Feb 2023 14:08:17 -0800 Subject: [PATCH 4/4] update react-experiments snapshot --- .../components/Pagination/__snapshots__/Pagination.test.tsx.snap | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/react-experiments/src/components/Pagination/__snapshots__/Pagination.test.tsx.snap b/packages/react-experiments/src/components/Pagination/__snapshots__/Pagination.test.tsx.snap index 3722468adb3872..72af827c12a1e5 100644 --- a/packages/react-experiments/src/components/Pagination/__snapshots__/Pagination.test.tsx.snap +++ b/packages/react-experiments/src/components/Pagination/__snapshots__/Pagination.test.tsx.snap @@ -1680,7 +1680,6 @@ exports[`Pagination render comboBox Pagination correctly 1`] = ` onKeyUp={[Function]} onMouseDown={[Function]} onMouseUp={[Function]} - role="presentation" tabIndex={-1} type="button" >