Open EvHaus opened 5 days ago
This caught us off guard too, when random checkbox tests started to fail after happy-dom update. Looking into it the developer was using testing-librarys
getByTextinstead of
getByLabelText`. So it was selecting the div node we had in the label, so our click events were no longer triggering the output.
We had to fix the tests by using getByLabelText
as a work around.
Describe the bug
The behavior of happy-dom v13.6.2 and v15.10.2 differs in that in v13 when you click on elements inside a
<label>
tag, it follows the browser spec and triggers theonChange
events for the wrapped input element. However, in v15 this behavior is no longer working. I'm not sure where between 13.6.2 and 15.10.2 this broke.To Reproduce
Given the following DOM structure rendered via
happy-dom
:And the following JS code
Expected behavior
If you click on the
span#description
element, it should trigger theonChange
event on theinput
element. In v13.6.2 it does. In browsers it does. But in v15.10.2 it doesn't.Screenshots N/A
Device: N/A
Additional context N/A