This repository reproduces false-positive Svelte accessibility warnings (a11y-click-events-have-key-events
and a11y-no-static-element-interactions
) when using Shoelace components like <sl-button>
.
Clone the repository:
git clone https://github.com/gengns/svelte-shoelace-a11y-issue.git
cd svelte-shoelace-a11y-issue
Install dependencies:
bun install
Run the development server:
bun dev
Check the console or terminal for the following warnings:
a11y-click-events-have-key-events
a11y-no-static-element-interactions
<sl-button on:click={() => alert('Clicked!')}>Click Me</sl-button>
No accessibility warnings should be triggered for <sl-button>
as it extends the native <button>
element and is fully accessible by default.
False-positive accessibility warnings are triggered by the Svelte compiler.