Skip to content

since svelte 4.0.0, wrong a11y warnings for <summary> element with click handler #8825

@raythurnvoid

Description

@raythurnvoid

Describe the bug

Adding on:click to a <summary> element is causing these two warnings:

A11y: visible, non-interactive elements with an on:click event must be accompanied by an on:keydown, on:keyup, or on:keypress event. (6:1)
A11y: <summary> with click handler must have an ARIA role (6:1)

They are both wrong, because <summary> is interactive and its default role is button: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/summary

Reproduction

https://svelte.dev/repl/941151732b1c4e32922a5a44232cf980?version=4.0.0

Logs

No response

System Info

N/A

Severity

annoyance

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions