svelecte icon indicating copy to clipboard operation
svelecte copied to clipboard

Dropdown.svelte & Control.svelte Warning non-interactive element

Open codeho opened this issue 1 year ago • 1 comments

Hi,

the Dropdown.svelte is throwing a warning:

A11y: visible, non-interactive elements with an on:click event must be accompanied by an on:keydown, on:keyup, or on:keypress event. (227:6) 225: {#if inputValue && creatable && !maxReached} 226: <div class="creatable-row-wrap"> 227: <div class="creatable-row" on:click={dispatch('select', inputValue)} on:mouseenter={dispatch('hover', listIndex.last)} ^ 228: class:active={currentListLength == dropdownIndex} 229: class:is-disabled={alreadyCreated.includes(inputValue)}

This is because in the element in line 227 there is a role="presentation" Attribute missing:

<div class="creatable-row" role="presentation" on:click={dispatch('select', inputValue)} on:mouseenter={dispatch('hover', listIndex.last)}

is there a way you could please add this?

The Same in Control.svelte Line 68 <div class="sv-control" class:is-active={$hasFocus} class:is-disabled={disabled} role="presentation" ....

thank you :)

T

codeho avatar Nov 15 '22 10:11 codeho