Skip to content

Custom Elements Boolean Attributes #15464

@Enes5519

Description

@Enes5519

Describe the bug

When boolean attribute false is passed to custom elements, it compiles as true.

Component:

<bl-input  label-fixed={false}></bl-input>

Expected:

<bl-input></bl-input>

Actual:

<bl-input label-fixed></bl-input>

Reproduction

https://svelte.dev/playground/1007079029d34ed68be7a0703a5d5ac7?version=5.22.5

Logs

System Info

System:
    OS: macOS 15.2
    CPU: (10) arm64 Apple M1 Pro
    Memory: 195.00 MB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.18.1 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 10.8.2 - /usr/local/bin/npm
    pnpm: 9.4.0 - /usr/local/bin/pnpm
    bun: 1.1.17 - ~/.bun/bin/bun
    Watchman: 2024.12.02.00 - /opt/homebrew/bin/watchman
  Browsers:
    Chrome: 133.0.6943.143
    Safari: 18.2
  npmPackages:
    @sveltejs/vite-plugin-svelte: ^5.0.3 => 5.0.3 
    svelte: ^5.22.5 => 5.22.5 
    vite: ^6.1.0 => 6.2.0

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