-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Unexpected value for draggable "false" becomes "true" #2935
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@RedHatter Do you have any thoughts about what role this plays in your recent research about attributes vs properties? I can confirm that having a hyperlink in regular html with It would appear that there are different kinds of boolean attributes, as something like |
There's nothing weird going on here. When a boolean attribute is set to We'll need to explicitly test for My first thought was this.
But that wouldn't work with
|
What I meant was that in regular pure HTML, So compiling But compiling |
Sorry my mistake. Yeah, my last comment was very wrong. Sorry, it's early for me I'm not quite awake yet. That part about HTML interpreting a boolean attribute set to "false" as true is just wrong. I double checked and |
Ah okay. Is I guess we need to do another sweep through the attributes left in in #3013 and see which additional ones should be removed. |
Hmm... yeah looks like it. The property is defined as a boolean which I assumed meant the attribute was a boolean attribute but I guess that's not always the case. I'll double check the rest. |
Svelte template:
HTML output:
Svelte REPL example
Expected output:
A workaround is to write:
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
andspellcheck
and convert the string"false"
to a booleanfalse
before setting the property.The text was updated successfully, but these errors were encountered: