Open arturog opened 5 years ago
OK, I think the problem is in Zombie:
when pressButton
is called, the event is correctly dispatched
https://github.com/assaf/zombie/blob/bbcd5a6b4c31ecc2bd697d48c0e56086ab7d0b8a/src/index.js#L360-L366
But after dispatching the event, we call _click
, which submits the form always.
https://github.com/assaf/zombie/blob/bbcd5a6b4c31ecc2bd697d48c0e56086ab7d0b8a/src/dom/forms.js#L241-L250
I think the correct place to disable the submission would be the _click
function. @assaf if you're happy to put the check in _click I can send a small patch.
Yes, please send a path
When pressing a
<button type="button">
contained within a<form>
, the form is incorrectly submitted.<button type="button">
should not by default submit the form as per specs.(I believe this is a jsdom problem...)