diff --git a/change/@fluentui-react-39740eb8-4b3a-42eb-8c4c-6938f59d123e.json b/change/@fluentui-react-39740eb8-4b3a-42eb-8c4c-6938f59d123e.json new file mode 100644 index 0000000000000..dd9c85edf7cd2 --- /dev/null +++ b/change/@fluentui-react-39740eb8-4b3a-42eb-8c4c-6938f59d123e.json @@ -0,0 +1,7 @@ +{ + "type": "minor", + "comment": "Accessibility update for picker selected item semantics and focus behavior\"", + "packageName": "@fluentui/react", + "email": "sarah.higley@microsoft.com", + "dependentChangeType": "patch" +} diff --git a/change/@fluentui-react-examples-43ed2ad1-99ec-4200-a9c8-b4ee31b5e0c8.json b/change/@fluentui-react-examples-43ed2ad1-99ec-4200-a9c8-b4ee31b5e0c8.json new file mode 100644 index 0000000000000..d96cdb57f9115 --- /dev/null +++ b/change/@fluentui-react-examples-43ed2ad1-99ec-4200-a9c8-b4ee31b5e0c8.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Update picker examples with labels\"", + "packageName": "@fluentui/react-examples", + "email": "sarah.higley@microsoft.com", + "dependentChangeType": "patch" +} diff --git a/packages/react-examples/src/react/Announced/Announced.SearchResults.Example.tsx b/packages/react-examples/src/react/Announced/Announced.SearchResults.Example.tsx index 89b01547c8af0..b03d06fbe02b6 100644 --- a/packages/react-examples/src/react/Announced/Announced.SearchResults.Example.tsx +++ b/packages/react-examples/src/react/Announced/Announced.SearchResults.Example.tsx @@ -65,6 +65,8 @@ export const AnnouncedSearchResultsExample: React.FunctionComponent = () => { {hasFilterText && } { onEmptyInputFocus={returnMostRecentlyUsed} getTextFromItem={getTextFromItem} pickerSuggestionsProps={suggestionProps} + selectionAriaLabel={'Selected contacts'} + removeButtonAriaLabel={'Remove'} className={'ms-PeoplePicker'} // eslint-disable-next-line react/jsx-no-bind onRemoveSuggestion={onRemoveSuggestion} diff --git a/packages/react-examples/src/react/PeoplePicker/PeoplePicker.Controlled.Example.tsx b/packages/react-examples/src/react/PeoplePicker/PeoplePicker.Controlled.Example.tsx index f30ed3d68c66d..a7e30c6b21f88 100644 --- a/packages/react-examples/src/react/PeoplePicker/PeoplePicker.Controlled.Example.tsx +++ b/packages/react-examples/src/react/PeoplePicker/PeoplePicker.Controlled.Example.tsx @@ -89,12 +89,15 @@ export const PeoplePickerControlledExample: React.FunctionComponent = () => { pickerSuggestionsProps={suggestionProps} className={'ms-PeoplePicker'} key={'controlled'} + selectionAriaLabel={'Selected contacts'} + removeButtonAriaLabel={'Remove'} selectedItems={currentSelectedItems} // eslint-disable-next-line react/jsx-no-bind onChange={onItemsChange} inputProps={{ onBlur: (ev: React.FocusEvent) => console.log('onBlur called'), onFocus: (ev: React.FocusEvent) => console.log('onFocus called'), + 'aria-label': 'Contacts', }} componentRef={picker} resolveDelay={300} diff --git a/packages/react-examples/src/react/PeoplePicker/PeoplePicker.LimitedSearch.Example.tsx b/packages/react-examples/src/react/PeoplePicker/PeoplePicker.LimitedSearch.Example.tsx index 7493ab455af00..1b33f9d6fbbb5 100644 --- a/packages/react-examples/src/react/PeoplePicker/PeoplePicker.LimitedSearch.Example.tsx +++ b/packages/react-examples/src/react/PeoplePicker/PeoplePicker.LimitedSearch.Example.tsx @@ -116,6 +116,8 @@ export const PeoplePickerLimitedSearchExample: React.FunctionComponent = () => { className={'ms-PeoplePicker'} onGetMoreResults={onFilterChanged} pickerSuggestionsProps={limitedSearchSuggestionProps} + selectionAriaLabel={'Selected contacts'} + removeButtonAriaLabel={'Remove'} onRemoveSuggestion={onRemoveSuggestion} /* eslint-enable react/jsx-no-bind */ inputProps={{ diff --git a/packages/react-examples/src/react/PeoplePicker/PeoplePicker.List.Example.tsx b/packages/react-examples/src/react/PeoplePicker/PeoplePicker.List.Example.tsx index 30ca271e4bce3..845e4c886abc3 100644 --- a/packages/react-examples/src/react/PeoplePicker/PeoplePicker.List.Example.tsx +++ b/packages/react-examples/src/react/PeoplePicker/PeoplePicker.List.Example.tsx @@ -98,6 +98,8 @@ export const PeoplePickerListExample: React.FunctionComponent = () => { className={'ms-PeoplePicker'} pickerSuggestionsProps={suggestionProps} key={'list'} + selectionAriaLabel={'Selected contacts'} + removeButtonAriaLabel={'Remove'} // eslint-disable-next-line react/jsx-no-bind onRemoveSuggestion={onRemoveSuggestion} onValidateInput={validateInput} diff --git a/packages/react-examples/src/react/PeoplePicker/PeoplePicker.Normal.Example.tsx b/packages/react-examples/src/react/PeoplePicker/PeoplePicker.Normal.Example.tsx index c07a04e85e3f7..b606191b599c8 100644 --- a/packages/react-examples/src/react/PeoplePicker/PeoplePicker.Normal.Example.tsx +++ b/packages/react-examples/src/react/PeoplePicker/PeoplePicker.Normal.Example.tsx @@ -101,6 +101,7 @@ export const PeoplePickerNormalExample: React.FunctionComponent = () => { // eslint-disable-next-line react/jsx-no-bind onRemoveSuggestion={onRemoveSuggestion} onValidateInput={validateInput} + selectionAriaLabel={'Selected contacts'} removeButtonAriaLabel={'Remove'} inputProps={{ onBlur: (ev: React.FocusEvent) => console.log('onBlur called'), diff --git a/packages/react-examples/src/react/PeoplePicker/PeoplePicker.PreselectedItems.Example.tsx b/packages/react-examples/src/react/PeoplePicker/PeoplePicker.PreselectedItems.Example.tsx index c1b7b2260eb01..e2cdce009be62 100644 --- a/packages/react-examples/src/react/PeoplePicker/PeoplePicker.PreselectedItems.Example.tsx +++ b/packages/react-examples/src/react/PeoplePicker/PeoplePicker.PreselectedItems.Example.tsx @@ -98,6 +98,8 @@ export const PeoplePickerPreselectedItemsExample: React.FunctionComponent = () = className={'ms-PeoplePicker'} defaultSelectedItems={peopleList.slice(0, 3)} key={'list'} + selectionAriaLabel={'Selected contacts'} + removeButtonAriaLabel={'Remove'} pickerSuggestionsProps={suggestionProps} // eslint-disable-next-line react/jsx-no-bind onRemoveSuggestion={onRemoveSuggestion} diff --git a/packages/react-examples/src/react/PeoplePicker/PeoplePicker.ProcessSelection.Example.tsx b/packages/react-examples/src/react/PeoplePicker/PeoplePicker.ProcessSelection.Example.tsx index e3fa60d7af81e..5c5e65aeb2bf2 100644 --- a/packages/react-examples/src/react/PeoplePicker/PeoplePicker.ProcessSelection.Example.tsx +++ b/packages/react-examples/src/react/PeoplePicker/PeoplePicker.ProcessSelection.Example.tsx @@ -100,6 +100,7 @@ export const PeoplePickerProcessSelectionExample: React.FunctionComponent = () = // eslint-disable-next-line react/jsx-no-bind onRemoveSuggestion={onRemoveSuggestion} onValidateInput={validateInput} + selectionAriaLabel={'Selected contacts'} removeButtonAriaLabel={'Remove'} onItemSelected={onItemSelected} inputProps={{ diff --git a/packages/react-examples/src/react/Pickers/Picker.CustomResult.Example.tsx b/packages/react-examples/src/react/Pickers/Picker.CustomResult.Example.tsx index e310be807d237..8794f36ca46b4 100644 --- a/packages/react-examples/src/react/Pickers/Picker.CustomResult.Example.tsx +++ b/packages/react-examples/src/react/Pickers/Picker.CustomResult.Example.tsx @@ -384,6 +384,8 @@ export const PickerCustomResultExample: React.FunctionComponent = () => { onRenderItem={SelectedDocumentItem} getTextFromItem={getTextFromItem} pickerSuggestionsProps={pickerSuggestionsProps} + selectionAriaLabel="Selected documents" + selectionRole="group" disabled={isPickerDisabled} inputProps={inputProps} /> diff --git a/packages/react-examples/src/react/Pickers/TagPicker.Basic.Example.tsx b/packages/react-examples/src/react/Pickers/TagPicker.Basic.Example.tsx index 9e7952deadf72..1ea82ddbb08f8 100644 --- a/packages/react-examples/src/react/Pickers/TagPicker.Basic.Example.tsx +++ b/packages/react-examples/src/react/Pickers/TagPicker.Basic.Example.tsx @@ -85,6 +85,7 @@ export const TagPickerBasicExample: React.FunctionComponent = () => { { +
-
- -
+ } + value="" + />
diff --git a/packages/react-examples/src/react/__snapshots__/PeoplePicker.Compact.Example.tsx.shot b/packages/react-examples/src/react/__snapshots__/PeoplePicker.Compact.Example.tsx.shot index b35d667731b9a..f9e70c4302642 100644 --- a/packages/react-examples/src/react/__snapshots__/PeoplePicker.Compact.Example.tsx.shot +++ b/packages/react-examples/src/react/__snapshots__/PeoplePicker.Compact.Example.tsx.shot @@ -5,103 +5,98 @@ exports[`Component Examples renders PeoplePicker.Compact.Example.tsx correctly 1
+
-
- -
+ } + value="" + />
@@ -162,7 +157,7 @@ exports[`Component Examples renders PeoplePicker.Compact.Example.tsx correctly 1 outline: 1px solid WindowText; } data-ktp-execute-target={true} - id="checkbox-2" + id="checkbox-1" onChange={[Function]} type="checkbox" /> @@ -190,7 +185,7 @@ exports[`Component Examples renders PeoplePicker.Compact.Example.tsx correctly 1 right: 0px; top: 0px; } - htmlFor="checkbox-2" + htmlFor="checkbox-1" >
@@ -349,7 +344,7 @@ exports[`Component Examples renders PeoplePicker.Compact.Example.tsx correctly 1 right: 0px; top: 0px; } - htmlFor="checkbox-3" + htmlFor="checkbox-2" >
+
-
- -
+ } + value="" + />
@@ -2093,7 +2089,7 @@ exports[`Component Examples renders PeoplePicker.Controlled.Example.tsx correctl outline: 1px solid WindowText; } data-ktp-execute-target={true} - id="checkbox-37" + id="checkbox-36" onChange={[Function]} type="checkbox" /> @@ -2121,7 +2117,7 @@ exports[`Component Examples renders PeoplePicker.Controlled.Example.tsx correctl right: 0px; top: 0px; } - htmlFor="checkbox-37" + htmlFor="checkbox-36" >
@@ -2280,7 +2276,7 @@ exports[`Component Examples renders PeoplePicker.Controlled.Example.tsx correctl right: 0px; top: 0px; } - htmlFor="checkbox-38" + htmlFor="checkbox-37" >
+
-
- -
+ } + value="" + />
@@ -162,7 +157,7 @@ exports[`Component Examples renders PeoplePicker.LimitedSearch.Example.tsx corre outline: 1px solid WindowText; } data-ktp-execute-target={true} - id="checkbox-2" + id="checkbox-1" onChange={[Function]} type="checkbox" /> @@ -190,7 +185,7 @@ exports[`Component Examples renders PeoplePicker.LimitedSearch.Example.tsx corre right: 0px; top: 0px; } - htmlFor="checkbox-2" + htmlFor="checkbox-1" >
@@ -349,7 +344,7 @@ exports[`Component Examples renders PeoplePicker.LimitedSearch.Example.tsx corre right: 0px; top: 0px; } - htmlFor="checkbox-3" + htmlFor="checkbox-2" >