Skip to content

Commit

Permalink
fix: remove role attribute from cloned item
Browse files Browse the repository at this point in the history
  • Loading branch information
web-padawan committed Oct 22, 2019
1 parent 651e89d commit a7c5761
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/vaadin-select.html
Expand Up @@ -568,6 +568,7 @@
labelItem._sourceItem = selected;

labelItem.removeAttribute('tabindex');
labelItem.removeAttribute('role');

this._valueElement.appendChild(labelItem);

Expand Down
8 changes: 8 additions & 0 deletions test/select-test.html
Expand Up @@ -355,6 +355,14 @@
expect(valueElement.hasAttribute('tabindex')).to.be.false;
});

it('Should remove role when cloning the selected element', () => {
menu.selected = 2;
const itemElement = select._items[menu.selected];
const valueElement = select._valueElement.firstChild;
expect(itemElement.tabIndex).to.be.equal(0);
expect(valueElement.hasAttribute('role')).to.be.false;
});

it('Should update selection slot textContent with the selected item `label` string', () => {
menu.selected = 1;
expect(select._valueElement.textContent.trim()).to.be.equal('o2');
Expand Down

0 comments on commit a7c5761

Please sign in to comment.