New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add mocks for element scrolling methods #1422
Comments
PR welcome |
Workaround for jsdom/jsdom#1422
This is a workaround for jsdom/jsdom#1422. This just prevents a bunch of console.error output from cluttering the test results.
This is a workaround for jsdom/jsdom#1422. This just prevents a bunch of console.error output from cluttering the test results.
This is a workaround for jsdom/jsdom#1422. This just prevents a bunch of console.error output from cluttering the test results.
How far is this issue to be close? |
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')); |
This affecting me to. I've tried many variations of overriding it, such as:
But I either get an error that I can't override, or it does nothing. Am I doing something wrong? |
I know this is old, but are you all still open to a PR to change this? If scrollX, scrollY, etc are all hardcoded to 0, it seems like it makes sense that |
We need to tackle this problem comprehensively. Let's roll discussions into #2751. |
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.The text was updated successfully, but these errors were encountered: