From cd30aa2003030fe979290361e89d625903ecec18 Mon Sep 17 00:00:00 2001 From: Yuichiro Yamashita Date: Tue, 6 Dec 2022 00:08:37 +0900 Subject: [PATCH] update --- site/content/docs/03-template-syntax.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/site/content/docs/03-template-syntax.md b/site/content/docs/03-template-syntax.md index 0d9de3bbb9..37bd4fa403 100644 --- a/site/content/docs/03-template-syntax.md +++ b/site/content/docs/03-template-syntax.md @@ -124,7 +124,9 @@ 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 rounded to `1` because `step` defaults to `1` before being set. To fix it, `value` should set last. +> Sometimes, the attribute order matters as Svelte sets attributes sequentially in JavaScript. For example, ``, Svelte will attempt to set the value to `1` (rounding up from 0.5 as the step by default is 1), and then set the step to `0.1`. To fix this, change it to ``. + +> Another example is ``. Svelte will set the img `src` before making the img element `loading="lazy"`, which is probably too late. Change this to `` to make the image lazily loaded. ---