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

CustomEvent does not take falsy detail value #701

Closed
CSchulz opened this issue Jan 26, 2023 · 3 comments · Fixed by #702
Closed

CustomEvent does not take falsy detail value #701

CSchulz opened this issue Jan 26, 2023 · 3 comments · Fixed by #702
Labels
bug Something isn't working

Comments

@CSchulz
Copy link
Contributor

CSchulz commented Jan 26, 2023

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Create a CustomEvent new CustomEvent(eventName, { detail: undefined })
  2. Wondering why detail is null
    image

Expected behavior
The detail value should return the given input detail value.

Device:

  • Version happy-dom@8.1.5

Additional context
Wrong handling of detail with falsy check:

if (eventInit) {
this.detail = eventInit.detail || null;
}
}

@CSchulz CSchulz added the bug Something isn't working label Jan 26, 2023
CSchulz added a commit to CSchulz/happy-dom that referenced this issue Jan 26, 2023
@CSchulz
Copy link
Contributor Author

CSchulz commented Feb 3, 2023

@capricorn86 Did you forget my patch? It seems not to be merged into master.

capricorn86 added a commit that referenced this issue Feb 3, 2023
#701@patch: fix handling of falsy CustomEvent detail value
@capricorn86
Copy link
Owner

Hi @CSchulz! 🙂

I'm sorry, it seems like I made a mistake when merging your pull request and just closed it instead 🤦‍♂️ Not sure how it happened.

It has been merged now and will be released any moment.

@capricorn86
Copy link
Owner

It has been released now:
https://github.com/capricorn86/happy-dom/releases/tag/v8.2.4

Thanks again for your contribution! 🌟

CSchulz added a commit to CSchulz/happy-dom that referenced this issue Feb 3, 2023
capricorn86 added a commit that referenced this issue Feb 3, 2023
#701@trivial: Add CustomEvent test.
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