Skip to content
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

t.scroll is not a function #1162

Open
joshkel opened this issue Feb 21, 2023 · 1 comment
Open

t.scroll is not a function #1162

joshkel opened this issue Feb 21, 2023 · 1 comment

Comments

@joshkel
Copy link

joshkel commented Feb 21, 2023

After upgrading from scroll-into-view-if-needed 3.0.4 to 3.0.5, one of our Jest tests has started failing with the following error:

t.scroll is not a function

See https://codesandbox.io/s/scroll-into-view-3-0-5-zsbh6k?file=/src/index.test.js for a test case.

@joshkel
Copy link
Author

joshkel commented Mar 29, 2023

This issue was introduced by 6472ede. jsdom doesn't implement Element.scroll (see jsdom/jsdom#1422 and jsdom/jsdom#2626), so scroll-into-view-if-needed now throws errors if used in a jsdom environment, such as Jest uses.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant