<style>
.container {
max-width: 300px;
width: 100%;
max-height: 300px;
overflow: scroll;
margin-top: 20px;
}
.demo-widget {
background: #f1f1f1;
height: 100%;
width: 100%;
display: flex;
justify-content: center;
align-items: center;
}
</style>
<label>
<input type="checkbox" bind:checked={useWindow} />
Use document
</label>
<label>
Sensor value
<input type=number bind:value={sensor} />
</label>
<div class:container={!useWindow} bind:this={container}>
<Grid bind:items={items} rowHeight={100} let:item let:dataItem {cols} {scroller} {sensor}>
<div class=demo-widget>{dataItem.id}</div>
</Grid>
</div>