From 7cd2fdb192c8a9a5944921f28f59150b41d287ab Mon Sep 17 00:00:00 2001 From: Yuichiro Yamashita Date: Sun, 4 Sep 2022 17:49:23 +0900 Subject: [PATCH] update sentence and position --- site/content/docs/03-template-syntax.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/site/content/docs/03-template-syntax.md b/site/content/docs/03-template-syntax.md index a5b31c0ca6..e99619612e 100644 --- a/site/content/docs/03-template-syntax.md +++ b/site/content/docs/03-template-syntax.md @@ -124,6 +124,8 @@ An element or component can have multiple spread attributes, interspersed with r > The `value` attribute of an `input` element or its children `option` elements must not be set with spread attributes when using `bind:group` or `bind:checked`. Svelte needs to be able to see the element's `value` directly in the markup in these cases so that it can link it to the bound variable. +> Sometimes, the attribute order matters as Svelte sets attributes sequentially in JavaScript. For example, ``, the value will be 1 because `step` is set after `value` is set. To fix it, `value` should set last. + --- ### Text expressions @@ -643,8 +645,6 @@ If you're using `bind:` directives together with `on:` directives, the order tha Here we were binding to the value of a text input, which uses the `input` event. Bindings on other elements may use different events such as `change`. -> Svelte bind attributes by JavaScript, so sometimes binding order is important. For example, ``, the value will be 1 because `step` is set after `value` is set. In this example, `value` should set at the last. - ##### Binding `