🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

scroll-blocker

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

scroll-blocker

use case :

latest
npmnpm
Version
1.0.1
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

ScrollBlocker : disable the scrollbar

use case :

  • for a Modal Box

Configuration

import { disableScroll, enableScroll } from "scroll-blocker";

// disable scroll for BODY element
disableScroll();
enableScroll();

// disable scroll for #container element
let targetElement = document.querySelector("#container");
disableScroll(targetElement);
enableScroll(targetElement);

with Vue3

import { createApp } from "vue";
import { scrollLockDirective } from "scroll-blocker/scroll-lock-directive";
import App from "./App.vue";

const app = createApp(App);
app.directive("scroll-lock", scrollLockDirective);
app.mount(document.querySelector("#app"));
<!-- note that the target element is not the FileManager but
the #el-to-lock or document.body if no value -->
<file-manager v-scroll-lock:active />
<file-manager v-scroll-lock:active="'#el-to-lock'" />

TODO: for the moment does not manage the change of state.

<file-manager v-scroll-lock:[isActive] />
<file-manager v-scroll-lock:[isActive]="'#el-to-lock'" />

FAQs

Package last updated on 09 Jun 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts