scrolllock
Prevents page scrolling while an element is active by locking the document’s scroll. Commonly used for modals and overlays.
Usage
<script>
import { scrolllock } from 'svxui';
</script>
<div
{@attach scrolllock({
// Enable/disable scroll lock
enabled: true
})}
>
{#each { length: 200 }, i (i)}
<div>Item {i}</div>
{/each}
</div>API Reference
ScrolllockOptions
| Property | Type | Default | Description |
|---|---|---|---|
enabled | boolean | true | Enable/disable scroll lock |