Skip to content

Commit

Permalink
Revert "fix(multi-select): fix DAP violations (#4991)"
Browse files Browse the repository at this point in the history
This reverts commit 8a20d0e.
  • Loading branch information
joshblack committed Jan 13, 2020
1 parent edbc0fc commit 99606a8
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ exports[`Dropdown should render 1`] = `
id="test-dropdown"
onClick={[Function]}
onKeyDown={[Function]}
role="listbox"
tabIndex="-1"
>
<ListBoxField
aria-disabled={false}
Expand Down Expand Up @@ -251,6 +253,8 @@ exports[`Dropdown should render custom item components 1`] = `
id="test-dropdown"
onClick={[Function]}
onKeyDown={[Function]}
role="listbox"
tabIndex="-1"
>
<ListBoxField
aria-disabled={false}
Expand Down Expand Up @@ -583,6 +587,8 @@ exports[`Dropdown should render with strings as items 1`] = `
id="test-dropdown"
onClick={[Function]}
onKeyDown={[Function]}
role="listbox"
tabIndex="-1"
>
<ListBoxField
aria-disabled={false}
Expand Down
2 changes: 2 additions & 0 deletions packages/react/src/components/ListBox/ListBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ const ListBox = ({
<>
<div
{...rest}
role="listbox"
tabIndex="-1"
className={className}
ref={innerRef}
onKeyDown={handleOnKeyDown}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ exports[`ListBox should render 1`] = `
<div
class="bx--list-box__container bx--list-box"
id="test-listbox"
role="listbox"
tabindex="-1"
>
<div
aria-label="Open menu"
Expand All @@ -37,6 +39,8 @@ exports[`ListBox should render 1`] = `
id="test-listbox"
onClick={[Function]}
onKeyDown={[Function]}
role="listbox"
tabIndex="-1"
>
<ListBoxField
id="test-listbox"
Expand Down
6 changes: 5 additions & 1 deletion packages/react/src/components/MultiSelect/MultiSelect.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ export default class MultiSelect extends React.Component {
render() {
const { highlightedIndex, isOpen } = this.state;
const {
ariaLabel,
className: containerClassName,
id,
items,
Expand Down Expand Up @@ -302,6 +303,7 @@ export default class MultiSelect extends React.Component {
return (
<ListBox
id={id}
aria-label={ariaLabel}
type={type}
size={size}
className={className}
Expand All @@ -310,6 +312,8 @@ export default class MultiSelect extends React.Component {
invalid={invalid}
invalidText={invalidText}
isOpen={isOpen}
aria-labelledby={labelId}
aria-describedby={helperId}
{...getRootProps({ refKey: 'innerRef' })}>
{invalid && (
<WarningFilled16
Expand Down Expand Up @@ -340,7 +344,7 @@ export default class MultiSelect extends React.Component {
/>
</ListBox.Field>
{isOpen && (
<ListBox.Menu aria-labelledby={`${labelId}`} id={id}>
<ListBox.Menu aria-label={ariaLabel} id={id}>
{sortItems(items, {
selectedItems: {
top: selectedItems,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ exports[`MultiSelect.Filterable should render 1`] = `
className="bx--multi-select bx--combo-box bx--multi-select--filterable bx--list-box"
onClick={[Function]}
onKeyDown={[Function]}
role="listbox"
tabIndex="-1"
>
<ListBoxField
aria-expanded={false}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ exports[`MultiSelect should render 1`] = `
stateReducer={[Function]}
>
<ListBox
aria-labelledby="multiselect-label-1"
className="bx--multi-select"
disabled={false}
id="test-multiselect"
Expand All @@ -86,10 +87,13 @@ exports[`MultiSelect should render 1`] = `
type="default"
>
<div
aria-labelledby="multiselect-label-1"
className="bx--multi-select bx--list-box"
id="test-multiselect"
onClick={[Function]}
onKeyDown={[Function]}
role="listbox"
tabIndex="-1"
>
<ListBoxField
aria-disabled={false}
Expand Down

0 comments on commit 99606a8

Please sign in to comment.