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

scrollWidth is undefined in document.documentElement #1109

Closed
wojtekmaj opened this issue Oct 3, 2023 · 2 comments · Fixed by #1111
Closed

scrollWidth is undefined in document.documentElement #1109

wojtekmaj opened this issue Oct 3, 2023 · 2 comments · Fixed by #1111
Assignees
Labels
bug Something isn't working

Comments

@wojtekmaj
Copy link
Contributor

Describe the bug

scrollWidth is undefined in document.documentElement. Oddly enough, scrollHeight is set just fine.

To Reproduce

https://npm.runkit.com/happy-dom

var {Window} = require("happy-dom")

const window = new Window();
console.log('scrollWidth', window.document.documentElement.scrollWidth);
console.log('scrollHeight', window.document.documentElement.scrollHeight);

Expected behavior

scrollWidth to be defined and set to 0 just like scrollHeight is.

Additional context

Commit with tests failing after replacing JSDom with Happy DOM:
wojtekmaj/react-hooks@bde9864

@wojtekmaj wojtekmaj added the bug Something isn't working label Oct 3, 2023
wojtekmaj added a commit to wojtekmaj/happy-dom that referenced this issue Oct 3, 2023
wojtekmaj added a commit to wojtekmaj/happy-dom that referenced this issue Oct 3, 2023
@capricorn86 capricorn86 self-assigned this Oct 3, 2023
@capricorn86 capricorn86 linked a pull request Oct 3, 2023 that will close this issue
capricorn86 added a commit that referenced this issue Oct 3, 2023
…defined-in-documentdocumentelement

#1109@minor: Adds support for Element.scrollWidth.
@capricorn86
Copy link
Owner

Thank you for reporting @wojtekmaj! 🙂

There is a fix in now.

You can read more about the release here:
https://github.com/capricorn86/happy-dom/releases/tag/v12.7.0

@davidortner-ipex
Copy link

Thank you for creating a fix PR as well ⭐

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants