happy-dom icon indicating copy to clipboard operation
happy-dom copied to clipboard

Button[form=id] not triggering form submit

Open zaalbarxx opened this issue 1 year ago • 0 comments

Describe the bug It seems that there is some issue with propagating submit event to the form using button which has [form=formId] attribute. In JSDOM and DOM such click "finds" form with given ID and triggers submit regardless of button being part of the form or not.

To Reproduce

https://stackblitz.com/edit/vitejs-vite-zhgfzj?file=src%2FApp.jsx Thanks to @denniseffing

Expected behavior Form submission should be triggered.

Device:

  • OS: Windows

Additional context Personally I'm using Vitest and also encountered this problem when trying to switch from JSDOM to happy-dom. I remember that there was also an issue regarding this in JSDOM https://github.com/jsdom/jsdom/issues/2368. The link to the spec is also in related JSDOM issue.

zaalbarxx avatar Sep 27 '23 13:09 zaalbarxx