Skip to content

Unexpected value for draggable "false" becomes "true" #2935

Closed
@bfanger

Description

@bfanger

Svelte template:

<img draggable="false">

HTML output:

<img draggable="true">

Svelte REPL example

Expected output:

<img draggable="false">

A workaround is to write:

<img draggable={false}>

The cause

The svelte compiles generates img0.draggable = "false";
"false" is converted (by the browser) to true, and updates the DOM to draggable="true"

Svelte should be made aware of attributes like draggable and spellcheck and convert the string "false" to a boolean false before setting the property.

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