Skip to content

Commit

Permalink
fix(multi-select): fix DAP violations (#4991)
Browse files Browse the repository at this point in the history
* fix(multi-select): add arialabeledby to menu

* fix(list-box): remove role from listbox

* chore: remove console log

* chore: update snapshots

Co-authored-by: TJ Egan <[email protected]>
  • Loading branch information
2 people authored and joshblack committed Jan 13, 2020
1 parent f19b795 commit be3a798
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,6 @@ exports[`Dropdown should render 1`] = `
id="test-dropdown"
onClick={[Function]}
onKeyDown={[Function]}
role="listbox"
tabIndex="-1"
>
<ListBoxField
aria-disabled={false}
Expand Down Expand Up @@ -253,8 +251,6 @@ 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 @@ -587,8 +583,6 @@ 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: 0 additions & 2 deletions packages/react/src/components/ListBox/ListBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@ 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,8 +12,6 @@ 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 @@ -39,8 +37,6 @@ exports[`ListBox should render 1`] = `
id="test-listbox"
onClick={[Function]}
onKeyDown={[Function]}
role="listbox"
tabIndex="-1"
>
<ListBoxField
id="test-listbox"
Expand Down
3 changes: 1 addition & 2 deletions packages/react/src/components/MultiSelect/MultiSelect.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,6 @@ export default class MultiSelect extends React.Component {
render() {
const { highlightedIndex, isOpen } = this.state;
const {
ariaLabel,
className: containerClassName,
id,
items,
Expand Down Expand Up @@ -341,7 +340,7 @@ export default class MultiSelect extends React.Component {
/>
</ListBox.Field>
{isOpen && (
<ListBox.Menu aria-label={ariaLabel} id={id}>
<ListBox.Menu aria-labelledby={`${labelId}`} id={id}>
{sortItems(items, {
selectedItems: {
top: selectedItems,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,6 @@ 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 @@ -90,8 +90,6 @@ exports[`MultiSelect should render 1`] = `
id="test-multiselect"
onClick={[Function]}
onKeyDown={[Function]}
role="listbox"
tabIndex="-1"
>
<ListBoxField
aria-disabled={false}
Expand Down

0 comments on commit be3a798

Please sign in to comment.