fix(dropdown): remove redundant role/id (#1327)

* fix(list-box): list box item should have a role and `aria-selected` attribute

* fix(dropdown): remove redundant role/id
This commit is contained in:
metonym 2022-06-01 18:55:27 -07:00 committed by GitHub
commit 66c96612bf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View file

@ -164,9 +164,9 @@
</label> </label>
{/if} {/if}
<ListBox <ListBox
role="{undefined}"
type="{type}" type="{type}"
size="{size}" size="{size}"
id="{id}"
name="{name}" name="{name}"
aria-label="{$$props['aria-label']}" aria-label="{$$props['aria-label']}"
class="bx--dropdown {direction === 'top' && 'bx--list-box--up'} {invalid && class="bx--dropdown {direction === 'top' && 'bx--list-box--up'} {invalid &&

View file

@ -12,9 +12,11 @@
</script> </script>
<div <div
role="option"
class:bx--list-box__menu-item="{true}" class:bx--list-box__menu-item="{true}"
class:bx--list-box__menu-item--active="{active}" class:bx--list-box__menu-item--active="{active}"
class:bx--list-box__menu-item--highlighted="{highlighted}" class:bx--list-box__menu-item--highlighted="{highlighted}"
aria-selected="{active}"
{...$$restProps} {...$$restProps}
on:click on:click
on:mouseenter on:mouseenter