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

element.getBoundingClientRect().toJSON() does not exist #1161

Closed
dragonofdeath opened this issue Nov 14, 2023 · 1 comment · Fixed by #1402
Closed

element.getBoundingClientRect().toJSON() does not exist #1161

dragonofdeath opened this issue Nov 14, 2023 · 1 comment · Fixed by #1402
Labels
bug Something isn't working

Comments

@dragonofdeath
Copy link

Describe the bug
element.getBoundingClientRect().toJSON() throws as its not implemented.

getBoundingClientRect() returns DOMRect which inherits its properties from DOMRectReadOnly and it has toJSON method, which is listed in mdn and is supported by all browsers. In my jsdom based tests I was using jsdom-pollyfill to solve the usecase and the implementaction code it is was using is something like this https://github.com/remirror/remirror/blob/main/packages/jest-remirror/src/jsdom-polyfills.ts#L90-L92 Would you mind PR adding this method?

@dragonofdeath dragonofdeath added the bug Something isn't working label Nov 14, 2023
domakas added a commit to domakas/happy-dom that referenced this issue Apr 12, 2024
domakas added a commit to domakas/happy-dom that referenced this issue Apr 12, 2024
capricorn86 added a commit to domakas/happy-dom that referenced this issue May 6, 2024
capricorn86 added a commit that referenced this issue May 6, 2024
fix: [#1161] Implement DOMReact and DOMReactReadOnly interfaces
@capricorn86
Copy link
Owner

Thank you for reporting @dragonofdeath ! 🙂

Big thanks to @domakas for contributing with a fix ⭐

https://github.com/capricorn86/happy-dom/releases/tag/v14.8.1

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.

2 participants