New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

hide-show-scroll

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hide-show-scroll - npm Package Compare versions

Comparing version 1.1.0 to 1.1.1

10

index.js
let html = document.documentElement
let scrollbarWidth
let defaultOverflowStyle
let hidden

@@ -9,4 +10,9 @@

}
// store existing overflow style
defaultOverflowStyle = defaultOverflowStyle || getComputedStyle(html).overflow
// calculate scrollbar width if any
scrollbarWidth = window.innerWidth - html.clientWidth
// hide overflow
html.style.overflow = 'hidden'
// add padding to compensate for scrollbar and prevent shifting
scrollbarWidth && (html.style.paddingRight = `${scrollbarWidth}px`)

@@ -17,4 +23,4 @@ hidden = true

let show = function () {
html.style.overflow = 'auto'
scrollbarWidth && (html.style.paddingRight = '0')
html.style.overflow = defaultOverflowStyle
scrollbarWidth && (html.style.paddingRight = 0)
hidden = false

@@ -21,0 +27,0 @@ }

2

package.json
{
"name": "hide-show-scroll",
"version": "1.1.0",
"version": "1.1.1",
"main": "dist/hide-show-scroll.umd.js",

@@ -5,0 +5,0 @@ "module": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc