-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
[docs] document details binding #6700
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
Conversation
|
For reference, here's a REPL of |
|
Like mentioned in the doc, you can bind a variable to almost all properties of a html tag. IMO it's not necessary to add a documentation section to all the binding possibilities. |
I don't think that's true? At least that isn't an assumption I've made, and I don't see where in the docs it says you can bind to almost any property. The Svelte compiler needs to define what event to listen to to make the binding work. There are also open issues about adding bindings to the readyState property of a media element (#6666) and the complete property of an img (#5105), so it's clearly not any property. All the bindings are validated here... svelte/src/compiler/compile/nodes/Element.ts Lines 556 to 661 in 4f9a260
... and pretty much all of them are explicitly mentioned in the docs and have their own tutorial chapters. So I don't think it's a stretch to document the |

I'm not sure when this was added, but I discovered that's it's possible to bind to the
openstate of a<details>element. This PR updates the docs accordingly.Should there be a new tutorial section for this as well?
Before submitting the PR, please make sure you do the following
[ ] It's really useful if your PR references an issue where it is discussed ahead of time. In many cases, features are absent for a reason. For large changes, please create an RFC: https://github.com/sveltejs/rfcs[feat],[fix],[chore], or[docs].[ ] Ideally, include a test that fails without this PR but passes with it.Tests
npm testand lint the project withnpm run lint