We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Describe the bug Happy-Dom evaluates a dataset key as undefined when it is set to an empty string. The browser evaluates it correctly to empty string.
To Reproduce Steps to reproduce the behavior:
document.body.dataset.test = ''
console.log(document.body.dataset.test)
undefined
''
Expected behavior It should be evaluated to empty string.
Additional context It is a regression introduced in v16.0.0 - latest working version is v15.11.7.
The text was updated successfully, but these errors were encountered:
A relevant regression test would be
element.setAttribute('data-test-empty', ''); const dataset = element.dataset; expect(dataset.testEmpty).toBe(''); expect(dataset.nonExistentKey).toBeUndefined(); dataset.testEmptyAlso = ''; expect(dataset.testEmptyAlso).toBe('');
Sorry, something went wrong.
No branches or pull requests
Describe the bug
Happy-Dom evaluates a dataset key as undefined when it is set to an empty string.
The browser evaluates it correctly to empty string.
To Reproduce
Steps to reproduce the behavior:
document.body.dataset.test = ''
console.log(document.body.dataset.test)
undefined
while it should output''
Expected behavior
It should be evaluated to empty string.
Additional context
It is a regression introduced in v16.0.0 - latest working version is v15.11.7.
The text was updated successfully, but these errors were encountered: