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.

Add mocks for element scrolling methods

See original GitHub issue

Element prototype has several methods to scroll it, but those methods are commented in the sources.

Why did you do this? For example window.scrollTo is a function that does nothing, just prints warning in console. I think that it would be okay for Element.prototype.scroll() method as well.

Issue Analytics

  • State:open
  • Created 8 years ago
  • Reactions:25
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

5reactions
M3kHcommented, Nov 12, 2018

How far is this issue to be close?

3reactions
theniksocommented, Mar 8, 2019

I also needed this, I ended up doing something like this:

const el = dom.window.document.querySelector(
    '.myScrollingElement',
  );
el.scrollTop = 12345;
el.dispatchEvent(new dom.window.Event('scroll'));
Read more comments on GitHub >

github_iconTop Results From Across the Web

Jest mock window.scrollTo - Stack Overflow
js file and add the path of this file into jest setupFiles configuration, both of these two ways work fine. For example,. index.spec.tsx...
Read more >
How to Create a Scrolling Website Mockup for Your Web ...
And in today's video, we're going to be talking about a few different ways to create website mock-ups including a scrolling website mock-up...
Read more >
Creating a basic directive that allows you to vertically scroll to ...
In this recipe, you'll create a directive to allow the user to scroll to a particular element on the page, on click.
Read more >
scrollToElement(selector [,options]) - Testim overview
Scroll to a given element on the screen. selector {string | TDKStepLocator} a CSS selector or smart locator for the elementoptions {object} scrollTarget ......
Read more >
Scroll wheel actions - Selenium
This method takes a web element as the sole argument. Regardless of whether the element is above or below the current viewscreen, the...
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