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

dataset camel case incorrect #435

Closed
quantuminformation opened this issue Mar 30, 2022 · 10 comments
Closed

dataset camel case incorrect #435

quantuminformation opened this issue Mar 30, 2022 · 10 comments
Assignees
Labels
bug Something isn't working high priority

Comments

@quantuminformation
Copy link

This situation camel case is not understood, whereas in the real DOM it is

image

@capricorn86 capricorn86 added bug Something isn't working high priority labels Mar 30, 2022
@capricorn86
Copy link
Owner

Thank you for reporting @quantuminformation! 🙂

I have fixed the issue now, together with adding support for reflecting all changes done to the dataset object with the attributes.

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

@capricorn86 capricorn86 self-assigned this Mar 31, 2022
@quantuminformation
Copy link
Author

top man

@quantuminformation
Copy link
Author

Wonder if this is related, I am doing a query for the dom and it's always false

export const loadedVideo = `<video data-play-index="1"  data-fully-loaded="true"></video>`

and in my test I assign above to the body and this dataset.fullyLoaded is always false

 const videoEl = document.querySelector(
        `[data-play-index="${this.videoPlayIndex + 1}"]`
      ) as HTMLVideoElement
      if (!videoEl!.dataset.fullyLoaded) {

@capricorn86
Copy link
Owner

@quantuminformation I tested this in Happy DOM now by running the following code:

element.setAttribute('data-fully-loaded', 'true');
expect(element.dataset.fullyLoaded).toBe('true');

It seems to work as expected.

@quantuminformation
Copy link
Author

what version?

@capricorn86
Copy link
Owner

Latest version (v2.55.0), but it should work from v2.53.0

@capricorn86
Copy link
Owner

You can test it here:
https://runkit.com/capricorn86/6247045b60a3c300084cdf73

@quantuminformation
Copy link
Author

quantuminformation commented Apr 1, 2022 via email

@quantuminformation
Copy link
Author

I wonder if this might be missing too:
TypeError: window.XMLHttpRequest is not a constructor

@quantuminformation
Copy link
Author

confirmed, error not there when switching to jsdom

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

No branches or pull requests

2 participants