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

#988@patch: Fix labels attribute with no IDs. #989

Merged
merged 4 commits into from Aug 2, 2023
Merged

#988@patch: Fix labels attribute with no IDs. #989

merged 4 commits into from Aug 2, 2023

Conversation

joshkel
Copy link
Contributor

@joshkel joshkel commented Jul 13, 2023

Refactor duplicate labels logic. I've only updated tests for HTMLInputElement but would be happy to update other tests if this approach seems reasonable.

Fixes #988.

Refactor duplicate labels logic.  I've only updated tests for HTMLInputElement but would be happy to update other tests if this approach seems reasonable.
@2516455367
Copy link

?

const {Window} = require('happy-dom');

const window = new Window({
url: "https://www.example.com"
});
document = window.document
document.write(<!DOCTYPE html><html><head><meta charset="UTF-8"><title></title></head><body id="555"></body></html>)
var id = Math.floor(Math.random() * 100000000)
console.log(id)
var span = document.createElement('span')
console.log(span.setAttribute)
console.log(span.removeAttribute)
console.log(span.removeChild)
span.setAttribute('id', id)
document.body.appendChild(span)
var ele = document.getElementById(id)
console.log('',ele.id)

@joshkel
Copy link
Contributor Author

joshkel commented Jul 21, 2023

@2516455367 , I'm not sure why you shared that code snippet here.

@2516455367
Copy link

2516455367 commented Jul 30, 2023 via email

capricorn86
capricorn86 previously approved these changes Aug 2, 2023
Copy link
Owner

@capricorn86 capricorn86 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your contribution @joshkel! 🌟

I made some fixes to the code, so that is better follows the code standard of the rest of the code in Happy DOM.

@2516455367 I believe I fixed your issue as well. If not, please open a new ticket.

@capricorn86 capricorn86 merged commit 7be5990 into capricorn86:master Aug 2, 2023
1 check passed
@joshkel joshkel deleted the task-988-label-ids branch August 2, 2023 16:56
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

Successfully merging this pull request may close these issues.

labels attribute misses labels without IDs
3 participants