Wrong event.target in dialog element when using formassociated custom element
Categories
(Core :: DOM: Events, defect)
Tracking
()
Tracking | Status | |
---|---|---|
firefox121 | --- | affected |
People
(Reporter: evertjan.garretsen, Unassigned)
References
(Blocks 1 open bug)
Details
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36
Steps to reproduce:
Whenever "static formassociated = true;" is used in a custom element, a event listener listening to click events (via event delegation) gets the wrong "event.target" when the click is inside in a dialog element within that custom element. This does not happen in Chrome, Safari, or Edge. Only in Firefox.
I created a github repo that demonstrates the bug. It's kinda hard to explain in text, easy to see when demonstrated.
git@github.com:evertjanMlbrgn/DialogCloseBug.git
Actual results:
The click event listener gets the wrong event.target and doesn't close the dialog as a result of that.
Expected results:
The click event listener should get the correct event.target and then the code will be able to close the dialog.
Reporter | ||
Comment 1•11 months ago
|
||
Sorry i copied the ssh link to my repo. The https link is https://github.com/evertjanMlbrgn/DialogCloseBug.git
Reporter | ||
Comment 2•11 months ago
|
||
Safari doesn't work at all i just discovered. Chrome and Edge work perfectly.
Comment 3•11 months ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::DOM: Events' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
Updated•11 months ago
|
Comment 4•11 months ago
|
||
Hello I have managed to reproduce the issue with firefox 121.0a1(2023-11-07) on Ubuntu 22.04 and MacOS 12 with the link provided in comment 1. I will mark this issue as NEW in order to get our developers involved.
Have a nice day!
Updated•11 months ago
|
Description
•