From 3dc0b0b2f066d76fb66802785fc1c893fee131ef Mon Sep 17 00:00:00 2001 From: Sarah Higley Date: Tue, 7 Sep 2021 10:56:32 -0700 Subject: [PATCH 1/4] only set live region on Dropdown when focused --- packages/react/src/components/Dropdown/Dropdown.base.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/react/src/components/Dropdown/Dropdown.base.tsx b/packages/react/src/components/Dropdown/Dropdown.base.tsx index 5a98a2dbba3f4c..8d19f4cbc13218 100644 --- a/packages/react/src/components/Dropdown/Dropdown.base.tsx +++ b/packages/react/src/components/Dropdown/Dropdown.base.tsx @@ -309,7 +309,7 @@ class DropdownInternal extends React.Component { From 4d05f2c15d746c8f78b2ad3f4a3e63db9b41109d Mon Sep 17 00:00:00 2001 From: Sarah Higley Date: Tue, 7 Sep 2021 11:24:31 -0700 Subject: [PATCH 2/4] update snapshots --- .../__snapshots__/ChoiceGroup.Custom.Example.tsx.shot | 2 -- .../DetailsList.CustomGroupHeaders.Example.tsx.shot | 2 -- .../react/__snapshots__/Dropdown.Basic.Example.tsx.shot | 6 ------ .../__snapshots__/Dropdown.Controlled.Example.tsx.shot | 2 -- .../Dropdown.ControlledMulti.Example.tsx.shot | 2 -- .../react/__snapshots__/Dropdown.Custom.Example.tsx.shot | 4 ---- .../react/__snapshots__/Dropdown.Error.Example.tsx.shot | 2 -- .../__snapshots__/Dropdown.Required.Example.tsx.shot | 4 ---- .../react/__snapshots__/Facepile.Basic.Example.tsx.shot | 2 -- .../__snapshots__/Facepile.Overflow.Example.tsx.shot | 2 -- .../ResizeGroup.OverflowSet.Example.tsx.shot | 2 -- .../Dropdown/__snapshots__/Dropdown.test.tsx.snap | 8 -------- 12 files changed, 38 deletions(-) diff --git a/packages/react-examples/src/react/__snapshots__/ChoiceGroup.Custom.Example.tsx.shot b/packages/react-examples/src/react/__snapshots__/ChoiceGroup.Custom.Example.tsx.shot index cb2272c7c37e6d..0d14f7e355ac7f 100644 --- a/packages/react-examples/src/react/__snapshots__/ChoiceGroup.Custom.Example.tsx.shot +++ b/packages/react-examples/src/react/__snapshots__/ChoiceGroup.Custom.Example.tsx.shot @@ -279,9 +279,7 @@ exports[`Component Examples renders ChoiceGroup.Custom.Example.tsx correctly 1`] tabIndex={-1} > Date: Tue, 7 Sep 2021 11:27:09 -0700 Subject: [PATCH 3/4] Change files --- ...luentui-react-87609c16-e599-49cf-91e0-2ac09923a565.json | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 change/@fluentui-react-87609c16-e599-49cf-91e0-2ac09923a565.json diff --git a/change/@fluentui-react-87609c16-e599-49cf-91e0-2ac09923a565.json b/change/@fluentui-react-87609c16-e599-49cf-91e0-2ac09923a565.json new file mode 100644 index 00000000000000..04dce1c95fa78e --- /dev/null +++ b/change/@fluentui-react-87609c16-e599-49cf-91e0-2ac09923a565.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Fix Dropdown to only add ARIA live region when focused", + "packageName": "@fluentui/react", + "email": "sarah.higley@microsoft.com", + "dependentChangeType": "patch" +} From 50f956186011915a4d03138a53313507e0a94d04 Mon Sep 17 00:00:00 2001 From: Sarah Higley Date: Wed, 8 Sep 2021 16:42:58 -0700 Subject: [PATCH 4/4] added a test for aria-live on focus --- .../react/src/components/Dropdown/Dropdown.test.tsx | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/packages/react/src/components/Dropdown/Dropdown.test.tsx b/packages/react/src/components/Dropdown/Dropdown.test.tsx index 8f9ce4f6a64112..dd316af8cfce94 100644 --- a/packages/react/src/components/Dropdown/Dropdown.test.tsx +++ b/packages/react/src/components/Dropdown/Dropdown.test.tsx @@ -147,6 +147,18 @@ describe('Dropdown', () => { expect(titleElement.text()).toEqual('1'); }); + it('Renders live region attributes only when focused', () => { + wrapper = mount(); + let titleElement = wrapper.find('.ms-Dropdown-title'); + + expect(titleElement.props()['aria-live']).toBeUndefined(); + + wrapper.find('.ms-Dropdown').simulate('focus'); + titleElement = wrapper.find('.ms-Dropdown-title'); + + expect(titleElement.props()['aria-live']).toEqual('polite'); + }); + it('does not change the selected item in when defaultSelectedKey changes', () => { wrapper = mount(); const titleElement = wrapper.find('.ms-Dropdown-title');