[docs] explain initial value for bind scroll (#7065)

Co-authored-by: Ben McCann <322311+benmccann@users.noreply.github.com>
pull/7137/head
Bjorn Lu 3 years ago committed by GitHub
parent 54f277cd8e
commit cc445839e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1671,6 +1671,7 @@ All except `scrollX` and `scrollY` are readonly.
<svelte:window bind:scrollY={y}/> <svelte:window bind:scrollY={y}/>
``` ```
> Note that the page will not be scrolled to the initial value to avoid accessibility issues. Only subsequent changes to the bound variable of `scrollX` and `scrollY` will cause scrolling. However, if the scrolling behaviour is desired, call `scrollTo()` in `onMount()`.
### `<svelte:body>` ### `<svelte:body>`

Loading…
Cancel
Save