Skip to content

Svelte 5: Typescript error on custom radio due to bind:group not being bindable #13501

@GeoffCox

Description

@GeoffCox

Describe the bug

When writing a custom radio input component that passes ...rest to the rendered input element, callers get a typescript error for bind:group not being bindable. This makes it impossible to create a custom radio component without re-implementing all of group behavior.

HTMLInputAttributes in svelte/elements lists 'bind:group'.

Attempted workaround #1: Added group as a local $props() variable in CustomRadio, and binding to the input element, but group is not a property on HTMLInputAttributes.

Attempted workaround #2: Added "bind:group": group as a local $props() variable in CustomRadio, but the caller error still exists.

Attempted workaround #3: Added "bind:group": group = $bindable(undefined) as a local $props() variable in CustomRadio, but the caller error still exists.

Reproduction

REPL repro

Logs

No response

System Info

Svelte 5 REPL as of 2024-10-04

Severity

blocking an upgrade

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