I want to modify the scrollTop on (the div underlying) a Row, in order to set its scroll position back to the top when the contained content changes.
This is the closest I can get:
<script>
export let content;
let ContentRow;
$: if (content.id && ContentRow) ContentRow.scrollTop = 0; // no good
</script>
<Row class="flex-fill mh-100 scroll" bind:this={ContentRow}>
...
</Row>
but that's no good since ContentRow doesn't have a scrollTop (until I create it there) - the one I want is, I think, the <div>'s in Row.svelte. But as far as I can see that's not accessible from binding to Row?
Hi @OJFord , yes it's a limitation with Svelte, you can'd bind this to custom components..
I could expose the inner div though with a new prop, will take a look
I want to modify the
scrollTop
on (thediv
underlying) aRow
, in order to set its scroll position back to the top when the contained content changes.This is the closest I can get:
but that's no good since
ContentRow
doesn't have ascrollTop
(until I create it there) - the one I want is, I think, the<div>
's inRow.svelte
. But as far as I can see that's not accessible from binding toRow
?