events: setting event cancelBubble calls stopPropagation#50405
events: setting event cancelBubble calls stopPropagation#50405mertcanaltin wants to merge 3 commits intonodejs:mainfrom
Conversation
Co-authored-by: Deokjin Kim <deokjin81.kim@gmail.com>
|
Can you add a test? |
benjamingr
left a comment
There was a problem hiding this comment.
Please add a test, changes lgtm
|
ı added a test |
| throw new ERR_INVALID_THIS('Event'); | ||
| if (value) { | ||
| this.stopPropagation(); | ||
| this.#propagationStopped = true; |
There was a problem hiding this comment.
Is setting cancelBubble supposed to be one-way? The proposed change doesn't modify this.#propagationStopped when value is false
nvm: For anyone else wondering the same thing see here: whatwg/dom#211
|
I wonder if I should do an update here? |
|
I guess flakky was the test 🤔 💭 |
|
passed 🎉🚀 |
|
@benjamingr I would be very happy if you can make an update here, now it seems to have passed all the tests |
|
@mertcanaltin I'm getting this warnings when landing - Can you take a look? I'll land anyway but would be good to get that fixed up. |
PR-URL: #50405 Reviewed-By: Matthew Aitken <maitken033380023@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Deokjin Kim <deokjin81.kim@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <midawson@redhat.com>
|
Landed in 399654f |
|
I am very sorry for the late response, thank you very much for correcting me @mhdawson ❤️ 🚀 |
PR-URL: #50405 Reviewed-By: Matthew Aitken <maitken033380023@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Deokjin Kim <deokjin81.kim@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <midawson@redhat.com>
PR-URL: #50405 Reviewed-By: Matthew Aitken <maitken033380023@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Deokjin Kim <deokjin81.kim@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <midawson@redhat.com>
PR-URL: #50405 Reviewed-By: Matthew Aitken <maitken033380023@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Deokjin Kim <deokjin81.kim@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <midawson@redhat.com>
PR-URL: nodejs#50405 Reviewed-By: Matthew Aitken <maitken033380023@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Deokjin Kim <deokjin81.kim@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <midawson@redhat.com>
issue: #50401
In this issue, we addressed the problem where setting cancelBubble to true unintentionally called the stopPropagation method. The solution ensures that stopPropagation is only called when cancelBubble is explicitly set to false, as it should be. This change prevents the method from being called when cancelBubble is true or not explicitly set