Skip to content

svelte(a11y-label-has-associated-control) shows incorrectly when using render snippet #11711

Open
@ViincentLim

Description

@ViincentLim

Describe the bug

The warning A form label must be associated with a control(a11y_label_has_associated_control)(svelte/valid-compile shows up even when the label has a render children inside.

<label>
	<span>{label}</span>
	{@render children?.()}
</label>

Reproduction

https://svelte-5-preview.vercel.app/#H4sIAAAAAAAAEz2O3WrDMAyFX0WIQVsI672b_uwNBrusd5ElSmdwZCOrhWH87sPOujvp45yPk3F2nhKaa0YeFkKDbzFih_oT65Me5JWwwxTuMlbSp1FcVPAD344WNVk8WbbqlhhEofYgwwe7GEmhwCxhgc3q2RwstywryTyMBO8SYoJcoVU_fJE3kFQc37qVjd_OT0J8Nk9n5WX1eFLI0GodPJNQzJ_2CC-xHtvdwXK_X4fXsdy3TtvdpzjwKTdQ-n37Ks8XIZ5I_r3n1-2uVM_axQ6XMLnZ0YRG5U7ls_wCoGD20E4BAAA=

<script lang="ts">
	import type { Snippet } from 'svelte';

	interface Props {
		label: string,
		children?: Snippet
	}

	let { label, children }: Props = $props();
</script>

<label>
	<span>{label}</span>
	{@render children?.()}
</label>

Logs

No response

System Info

"svelte": "5.0.0-next.136",
"svelte-eslint-parser": "^0.36.0",
"@sveltejs/kit": "^2.5.9",

Severity

annoyance

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions