question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Feature request: option to fire callback when no scrolling happened

See original GitHub issue

I currently have a feature that toggles a boolean to ‘block’ scrollIntoView() (and some other functions) from firing multiple times while it’s running, and then uses a callback to ‘unblock’ scrollIntoView() and these other functions. However, in some cases, scrollIntoView() doesn’t scroll (e.g., when isScrollable() returns false). This is expected (in my case it’s a navbar that only is scrollable in mobile widths), but there’s not a clean way to fire my callback in this case, and thus not a clean way to unblock my functions that fire after the callback toggles the boolean.

Sorry if this example is unclear. The main point of it is that I’d like a way to fire a callback in a no-op case. I was thinking an additional type might work.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
psixdevcommented, Jun 20, 2020

Sorry, I found an annoying mistake in my code. After fixing it, the problem stopped repeating itself. The library works as I expect

1reaction
KoryNunncommented, Apr 19, 2019

Thanks for that, Bug confirmed, test added, fix added, published as 1.9.6.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ScrollTrigger feature request: "onSnapInterrupt" callback - GSAP
Similar to the "onInterrupt" option for gsap tweens, "onSnapInterrupt" is a callback that fires when snapping is interrupted/cancelled due ...
Read more >
Scroll event firing too many times. I only want it to fire a ...
It fires all sorts of intermediate scroll events and does not tell you when things are done moving. So, we come up with...
Read more >
Quick Tip: How to Throttle Scroll Events - SitePoint
This technique helps with checking if we are at a specific part of the page. Given the size of the page, it takes...
Read more >
With scrollBar: true, callbacks stop firing · Issue #1556 - GitHub
I've noticed that with the scrollBar option set to true, the seems to be an issue ... After that, the callbacks only fire...
Read more >
Scroll Events and Intersection Observer - Beginner JavaScript
In this video we will learn about scroll events. A scroll event is when someone goes ahead and scrolls on the page or...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found