Closed hadriann closed 3 years ago
This seems to happen because the submit
event is handled globally at document level. It works well in regular DOM, as the event bubbles up. In shadow DOM, the event still bubbles up, but it doesn't propagate across the shadow DOM boundary because the composed
property of the submit event is false
.
Thanks for the report. I'll solve this by setting composed and handling it globally.
On Tue, 21 Apr 2020 at 21:17, Adrian Nita notifications@github.com wrote:
This seems to happen because the submit event is handled globally at document level. It works well in regular DOM, as the event bubbles up. In shadow DOM, the event still bubbles up, but it doesn't propagate across the shadow DOM boundary because the composed property of the submit event is false.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/GoogleChrome/dialog-polyfill/issues/195#issuecomment-617115077, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAA5DEDYOYE5FNZHGDCDP7LRNV6C3ANCNFSM4MNGX3AA .
But can you override the composed flag of the native submit event?
I've fixed this in 0.5.4.
In Firefox and Safari, inside a shadow DOM, submitting (via a submit button) a form with method set to "dialog" (inside a dialog element) triggers a page reload instead of closing the dialog with the proper
returnValue
.