fix: resolve a11y warnings from Svelte version 3.58 (#1732)

* chore(deps-dev): upgrade svelte to 3.58

* chore(a11y): ignore false positives

Referencing the upstream Carbon React implementation, these warnings can be ignored.

* fix(list-box-menu-item): set `tabindex` to `-1`

* chore: fix `tabindex` capitalization

The Svelte Language server does not detect `tabIndex` as a valid attribute.

Note, however, that `tabIndex` is correct when using it in JavaScript (e.g., `node.tabIndex`).
This commit is contained in:
Eric Liu 2023-05-18 11:53:17 -07:00 committed by GitHub
commit c02b4738bc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 16 additions and 13 deletions

View file

@ -58,6 +58,7 @@
</script>
<!-- svelte-ignore a11y-mouse-events-have-key-events -->
<!-- svelte-ignore a11y-interactive-supports-focus -->
<div
role="tablist"
class:bx--content-switcher="{true}"

View file

@ -20,6 +20,7 @@
<div
role="option"
tabindex="-1"
class:bx--list-box__menu-item="{true}"
class:bx--list-box__menu-item--active="{active}"
class:bx--list-box__menu-item--highlighted="{highlighted || active}"

View file

@ -62,7 +62,7 @@
<div
bind:this="{ref}"
role="button"
tabIndex="{disabled ? -1 : 0}"
tabindex="{disabled ? -1 : 0}"
class:bx--tag__close-icon="{true}"
on:click|preventDefault|stopPropagation="{(e) => {
if (!disabled) {

View file

@ -27,6 +27,7 @@
<slot />
</label>
{:else}
<!-- svelte-ignore a11y-interactive-supports-focus -->
<div
role="row"
class:bx--structured-list-row="{true}"

View file

@ -254,7 +254,7 @@
on:click|stopPropagation
on:mousedown|stopPropagation
class:bx--tooltip__content="{true}"
tabIndex="-1"
tabindex="-1"
role="dialog"
>
<slot />