Skip to content

Commit 5242ab9

Browse files
gtm-nayantanhauhaubenmccann
authored
[docs] Fix statement about the order of bind: and on: (#7357)
* 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 <[email protected]> * Update site/content/docs/02-template-syntax.md Co-authored-by: Tan Li Hau <[email protected]> Co-authored-by: Ben McCann <[email protected]>
1 parent 8b828a4 commit 5242ab9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,7 @@ On `<input>` elements with `type="file"`, you can use `bind:files` to get the [`
627627

628628
---
629629

630-
`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.
630+
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.
631631

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

644+
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`.
644645

645646
##### Binding `<select>` value
646647

0 commit comments

Comments
 (0)