Skip to content

Commit

Permalink
[docs] Fix statement about the order of bind: and on: (#7357)
Browse files Browse the repository at this point in the history
* Fix statement about order of bind: and on:

* It's just an example

* Revert and modify

* Update site/content/docs/02-template-syntax.md

Co-authored-by: Ben McCann <322311+benmccann@users.noreply.github.com>

* Update site/content/docs/02-template-syntax.md

Co-authored-by: Tan Li Hau <tanhauhau@users.noreply.github.com>
Co-authored-by: Ben McCann <322311+benmccann@users.noreply.github.com>
  • Loading branch information
3 people committed May 18, 2022
1 parent 8b828a4 commit 5242ab9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion site/content/docs/02-template-syntax.md
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,7 @@ On `<input>` elements with `type="file"`, you can use `bind:files` to get the [`

---

`bind:` can be used together with `on:` directives. The order that they are defined in determines the value of the bound variable when the event handler is called.
If you're using `bind:` directives together with `on:` directives, the order that they're defined in affects the value of the bound variable when the event handler is called.

```sv
<script>
Expand All @@ -641,6 +641,7 @@ On `<input>` elements with `type="file"`, you can use `bind:files` to get the [`
/>
```

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`.

##### Binding `<select>` value

Expand Down

0 comments on commit 5242ab9

Please sign in to comment.