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

happy-dom doesn't support setter for HTMLInput.valueAsNumber property #945

Closed
malko opened this issue Jun 1, 2023 · 5 comments
Closed
Labels
bug Something isn't working

Comments

@malko
Copy link
Contributor

malko commented Jun 1, 2023

Describe the bug
when testing with happy-dom you can get value using input.valueAsNumber but not set value with it as only getter are implemented

To Reproduce
Steps to reproduce the behavior:

  1. declare a test with an input[type=number] element
  2. try to set value using input.valueAsNumber
  3. See error: TypeError: Cannot set property valueAsNumber of [object Object] which has only a getter

Expected behavior
expect the input value to be set properly

@malko malko added the bug Something isn't working label Jun 1, 2023
@malko
Copy link
Contributor Author

malko commented Jun 1, 2023

Preparing a PR for adding both support for valueAsNumber and valueAsDate setter

malko added a commit to malko/happy-dom that referenced this issue Jun 2, 2023
malko added a commit to malko/happy-dom that referenced this issue Jun 4, 2023
malko added a commit to malko/happy-dom that referenced this issue Jun 4, 2023
malko added a commit to malko/happy-dom that referenced this issue Jun 4, 2023
malko added a commit to malko/happy-dom that referenced this issue Jun 4, 2023
@malko
Copy link
Contributor Author

malko commented Jun 4, 2023

Will add valueAsDate in a second PR if valueAsNumber is approved.

malko added a commit to malko/happy-dom that referenced this issue Jul 10, 2023
malko added a commit to malko/happy-dom that referenced this issue Jul 10, 2023
capricorn86 added a commit that referenced this issue Jul 10, 2023
#945@minor Add support for HTMLInputElement set valueAsNumber
@capricorn86
Copy link
Owner

Your fix has been released 🙂

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

@capricorn86
Copy link
Owner

Should we close this ticket or keep it open for valueAsDate?

@malko
Copy link
Contributor Author

malko commented Jul 10, 2023

I think we can create another issue for valueasdate and close this one if this is ok for you. Will work on it as soon as i can.

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

No branches or pull requests

2 participants