Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
v-body-scroll-lock
Advanced tools
Readme
A Vue directive to lock the body from scrolling without stopping the target element from scrolling.
Uses the body-scroll-lock library (https://github.com/willmcpo/body-scroll-lock).
Works on mobile and tablet (iOS, Android) and desktop (Chrome, Firefox, Safari).
yarn add v-body-scroll-lock
npm i v-body-scroll-lock --save
Add v-body-scroll-lock
or v-bsl
(short version) to the element which you want to keep scrollable.
v-body-scroll-lock
and v-bsl
take a boolean
as an argument like v-body-scroll-lock="modalIsOpen"
If modalIsOpen
is true, body scroll lock will be applied to other elements except for the one which has v-body-scroll-lock="modalIsOpen"
For a more deep example checkout App.vue
in /src/App.vue
.
<template>
<div v-body-scroll-lock="modalIsOpen"
v-show="modalIsOpen"
class="modal">
<p>This is a modal! I am scrollable while the body is not!</p>
<button @click="closeModal">Close modal</button>
</div>
</template>
<script>
export default {
name: 'modal',
data() {
return {
modalIsOpen: false,
}
},
methods: {
closeModal() {
this.modalIsOpen = false;
},
openModal() {
this.modalIsOpen = true;
}
}
}
</script>
Reserves the with of the scrollbar and prevents the unpleasant flickering effect that can occur when locking the body scroll.
More info here.
To enable the reserveScrollBarGap
option add :reserveScrollBarGap
after v-body-scroll-lock
or v-bsl
.
Example: v-body-scroll-lock:reserveScrollBarGap="modalIsOpen"
.
Issues can be created on the issues page.
To contribute, please make a pull request.
FAQs
Vue directive for an easy use of the body-scroll-lock library.
The npm package v-body-scroll-lock receives a total of 244 weekly downloads. As such, v-body-scroll-lock popularity was classified as not popular.
We found that v-body-scroll-lock demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.