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
Add support for HTMLButtonElement. #581
Conversation
a4b6dd3
to
2979bbc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! ⭐ Just some minor things.
packages/happy-dom/src/nodes/html-button-element/HTMLButtonElement.ts
Outdated
Show resolved
Hide resolved
packages/happy-dom/src/nodes/html-button-element/HTMLButtonElement.ts
Outdated
Show resolved
Hide resolved
packages/happy-dom/src/nodes/html-button-element/HTMLButtonElement.ts
Outdated
Show resolved
Hide resolved
Thank you for contributing @fsoikin! 🙂 Sorry for not looking into this PR earlier. There has been a lot in my private and work life. |
8d0adf6
to
11c1755
Compare
11c1755
to
b2e9dfa
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work ⭐
When writing some tests, I noticed this:
In a real browser, the last line would print out
true
. Checked in Chrome and FireFox.After digging a bit, I realized that
happy-dom
uses the genericHTMLElement
to represent a<button>
, which doesn't translate between standard button attributes and properties.This PR adds a
HTMLButtonElement
class and makes it translate some (not all) of the properties - specifically,value
,disabled
, andtype
.