Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@sveltejs/svelte-scroller

Package Overview
Dependencies
Maintainers
2
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sveltejs/svelte-scroller - npm Package Compare versions

Comparing version 1.0.4 to 1.0.5

4

CHANGELOG.md
# svelte-scroller changelog
## 1.0.5
* Handle case where scroller abruptly disappears from viewport
## 1.0.4

@@ -4,0 +8,0 @@

23

index.js

@@ -188,2 +188,3 @@ (function (global, factory) {

} else {
scroller.handleScroll();
if (index !== -1) scrollers.splice(index, 1);

@@ -271,6 +272,2 @@ }

// only update while the foreground is visible
// (only affects browsers without IntersectionObserver)
if (foreground.top > window.innerHeight || foreground.bottom < 0) return;
const foreground_height = foreground.bottom - foreground.top;

@@ -306,14 +303,14 @@ const background_height = background.bottom - background.top;

fixed = true;
}
for (index = 0; index < this.sections.length; index += 1) {
const section = this.sections[index];
const { top } = section.getBoundingClientRect();
for (index = 0; index < this.sections.length; index += 1) {
const section = this.sections[index];
const { top } = section.getBoundingClientRect();
const next = this.sections[index + 1];
const bottom = next ? next.getBoundingClientRect().top : this.refs.foreground.getBoundingClientRect().bottom;
const next = this.sections[index + 1];
const bottom = next ? next.getBoundingClientRect().top : this.refs.foreground.getBoundingClientRect().bottom;
if (bottom >= threshold_px) {
offset = (threshold_px - top) / (bottom - top);
break;
if (bottom >= threshold_px) {
offset = (threshold_px - top) / (bottom - top);
break;
}
}

@@ -320,0 +317,0 @@ }

{
"name": "@sveltejs/svelte-scroller",
"version": "1.0.4",
"version": "1.0.5",
"description": "A <Scroller> component for Svelte apps",

@@ -5,0 +5,0 @@ "svelte": "src/Scroller.html",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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