You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
A checkbox with the indeterminate state being true should go to false when clicked, but this is not happening with happy-dom, it does with jsdom.
And test it with chrome or firefox, with chrome it constantly make it true when clicked, and with firefox reloading the page will make it false or true changing the value on each reload.
The indeterminate state can only be set by javascript and is purely visual. It is the checked state that should determinate the new state when clicked not the indeterminate state at all.
So if your input is checked and indeterminate it should when clicked be unchecked,
if it was unchecked and indeterminate it should be checked when clicked.
There's still a problem with the happy-dom implementation, as triggering a click event on the element will not change the indeterminate state at all, but is should be passed to false.
Also I can see the actual implementation sets an attribute indeterminate on the input element but it should not as indeterminate is not meant to be an input attribute.
Describe the bug
A checkbox with the indeterminate state being true should go to false when clicked, but this is not happening with happy-dom, it does with jsdom.
To Reproduce
Minimal example: https://stackblitz.com/edit/vitest-dev-vitest-rzc6un?file=test%2Fbasic.test.ts
Switch the happy-dom to jsdom there to see the test succeed.
Expected behavior
When clicking a checkbox element, I expect the indeterminate state to switch to false.
The text was updated successfully, but these errors were encountered: