diff --git a/packages/office-ui-fabric-react/src/components/pickers/BasePicker.tsx b/packages/office-ui-fabric-react/src/components/pickers/BasePicker.tsx index 904fae8573a87d..ea937c324c7165 100644 --- a/packages/office-ui-fabric-react/src/components/pickers/BasePicker.tsx +++ b/packages/office-ui-fabric-react/src/components/pickers/BasePicker.tsx @@ -10,7 +10,6 @@ import { initializeComponentRef, } from '../../Utilities'; import { IProcessedStyleSet } from '../../Styling'; -import { IFocusZone, FocusZone, FocusZoneDirection } from '../../FocusZone'; import { Callout, DirectionalHint } from '../../Callout'; import { Selection, SelectionZone, SelectionMode } from '../../utilities/selection/index'; import { Suggestions } from './Suggestions/Suggestions'; @@ -94,7 +93,6 @@ export class BasePicker> extends React.Componen // Refs protected root = React.createRef(); protected input = React.createRef(); - protected focusZone = React.createRef(); protected suggestionElement = React.createRef>(); protected selection: Selection; @@ -178,8 +176,8 @@ export class BasePicker> extends React.Componen } public focus() { - if (this.focusZone.current) { - this.focusZone.current.focus(); + if (this.input.current) { + this.input.current.focus(); } } @@ -269,47 +267,46 @@ export class BasePicker> extends React.Componen screenReaderText: legacyStyles.screenReaderOnly, }; + const comboLabel = this.props['aria-label'] || inputProps?.['aria-label']; + return (
- - {this.getSuggestionsAlert(classNames.screenReaderText)} - -
- {items.length > 0 && ( - - {this.renderItems()} - - )} - {this.canAddItems() && ( - 0 ? this._ariaMap.selectedItems : undefined} - aria-expanded={!!this.state.suggestionsVisible} - aria-haspopup="listbox" - aria-label={this.props['aria-label'] || inputProps?.['aria-label']} - role="combobox" - disabled={disabled} - onInputChange={this.props.onInputChange} - /> - )} -
-
-
+ + {this.getSuggestionsAlert(classNames.screenReaderText)} + +
+ {items.length > 0 && ( + + {this.renderItems()} + + )} + {this.canAddItems() && ( + 0 ? this._ariaMap.selectedItems : undefined} + aria-expanded={!!this.state.suggestionsVisible} + aria-haspopup="listbox" + aria-label={this.props['aria-label'] || inputProps?.['aria-label']} + role="combobox" + disabled={disabled} + onInputChange={this.props.onInputChange} + /> + )} +
+
{this.renderSuggestions()}
); @@ -385,8 +382,8 @@ export class BasePicker> extends React.Componen (this.root.current.querySelectorAll('[data-selection-index]')[ Math.min(index!, items.length - 1) ] as HTMLElement | null); - if (newEl && this.focusZone.current) { - this.focusZone.current.focusElement(newEl); + if (newEl) { + newEl.focus(); } } else if (!this.canAddItems()) { this.resetFocus(items.length - 1); @@ -1015,6 +1012,8 @@ export class BasePickerListBelow> extends BaseP screenReaderText: legacyStyles.screenReaderOnly, }; + const comboLabel = this.props['aria-label'] || inputProps?.['aria-label']; + return (
@@ -1041,17 +1040,14 @@ export class BasePickerListBelow> extends BaseP
{this.renderSuggestions()} - {this.renderItems()} - +
);