Skip to content
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

'innerHTML' is not a valid binding error when following "contenteditable bindings" step in tutorial #3131

Closed
rmacklin opened this issue Jun 28, 2019 · 1 comment

Comments

@rmacklin
Copy link
Contributor

When applying the solution to the "contenteditable bindings" step of the tutorial, an error is thrown:

'innerHTML' is not a valid binding

(This happens when typing the solution out as well as when you click "Show me" to have the solution automatically applied.)

Screen capture (click to view at full resolution):

sveltebindinnerhtml

Additionally, the other suggestion of binding textContent also throws an error:

'textContent' is not a valid binding

Screen Shot 2019-06-28 at 2 38 05 PM

However, text works:

Screen Shot 2019-06-28 at 2 38 38 PM

I haven't already looked into the svelte code to see whether this is supposed to work or whether the tutorial is outdated. I may have some time to dig in and answer that later, but I figured I'd open the issue since other people might already know the answer. I'd be happy to help with a PR to fix the tutorial if it is indeed a documentation issue. (I can also try to submit a PR if it's a svelte bug, but that will probably require getting a bit more familiar with the code first.)

@rmacklin
Copy link
Contributor Author

Hmm, I just saw this comment: #2379 (comment)

This is released in 3.6.0 — the bindings got renamed to innerHTML and textContent, because they're just referencing properties of the element (and this is how existing bindings work). Thank you!

I was running with Svelte 3.5.4:

image

Now when I go back to the same page in the tutorial it's running Svelte 3.6.1 and appears things are working as expected:

image

I'll go ahead and close this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant