rob-balfre / svelte-select

Svelte Select. A select component for Svelte
https://svelte-select-examples.vercel.app
Other
1.27k stars 180 forks source link

Missing ARIA role warnings with Svelte 4 #610

Closed stephenlrandall closed 1 year ago

stephenlrandall commented 1 year ago

Svelte 4 now complains about missing ARIA roles, which svelte-select seems to have in three places (seen when building):

[vite-plugin-svelte] /node_modules/.pnpm/svelte-select@5.6.1/node_modules/svelte-select/Select.svelte:694:20 A11y: <div> with mouseover, click, keydown handlers must have an ARIA role
692:             {:else if filteredItems.length > 0}
693:                 {#each filteredItems as item, i}
694:                     <div
                         ^
695:                         on:mouseover={() => handleHover(i)}
696:                         on:focus={() => handleHover(i)}

[vite-plugin-svelte] /node_modules/.pnpm/svelte-select@5.6.1/node_modules/svelte-select/Select.svelte:743:20 A11y: <div> with click, keydown handlers must have an ARIA role
741:             {#if multiple}
742:                 {#each value as item, i}
743:                     <div
                         ^
744:                         class="multi-item"
745:                         class:active={activeValue === i}

[vite-plugin-svelte] /node_modules/.pnpm/svelte-select@5.6.1/node_modules/svelte-select/Select.svelte:669:0 A11y: <div> with mousedown handler must have an ARIA role
667: <svelte:window on:click={handleClickOutside} on:keydown={handleKeyDown} />
668: 
669: <div
     ^
670:     class="svelte-select {containerClasses}"
671:     class:multi={multiple}
josdejong commented 1 year ago

@rob-balfre can I create a small PR suppressing these three warnings as a temporary measure?

I guess v6 will take time before it is ready (https://github.com/rob-balfre/svelte-select/issues/611).

rob-balfre commented 1 year ago

Sure!

josdejong commented 1 year ago

Ok I will do that somewhere this week.

josdejong commented 1 year ago

I made a PR to fix these warnings: #624