From 147c00c150d0703511f31f1e88c9079d86d1d31e Mon Sep 17 00:00:00 2001 From: Yuval Date: Sun, 22 Mar 2026 22:27:29 +0000 Subject: [PATCH 1/2] Update dispatchEvent documentation for clarity Clarified the difference between native events and manually dispatched events in the dispatchEvent documentation. The previous phrasing implied that the actual event handler functions themselves are scheduled asynchronously on the Event Loop, but only the dispatch is. --- files/en-us/web/api/eventtarget/dispatchevent/index.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/files/en-us/web/api/eventtarget/dispatchevent/index.md b/files/en-us/web/api/eventtarget/dispatchevent/index.md index 71250dc401a9929..75e4a595ded4a1f 100644 --- a/files/en-us/web/api/eventtarget/dispatchevent/index.md +++ b/files/en-us/web/api/eventtarget/dispatchevent/index.md @@ -19,8 +19,7 @@ should have already been created and initialized using an {{domxref("Event/Event > [!NOTE] > When calling this method, the {{domxref("Event.target")}} property is initialized to the current `EventTarget`. -Unlike "native" events, which are fired by the browser and invoke event handlers -asynchronously via the [event loop](/en-US/docs/Web/JavaScript/Reference/Execution_model), +Unlike calling `dispatchEvent()` manually - "native" events, which are fired by the browser, schedule an asynchronous dispatch via the [event loop](/en-US/docs/Web/JavaScript/Reference/Execution_model). This dispatch uses the same process as `dispatchEvent()`. `dispatchEvent()` invokes event handlers _synchronously_. All applicable event handlers are called and return before `dispatchEvent()` returns. From 6c8e48835c2fd5f7ed1b55f79e8498d3ad9ce4e0 Mon Sep 17 00:00:00 2001 From: Yuval Date: Thu, 26 Mar 2026 21:04:37 +0000 Subject: [PATCH 2/2] Clarify differences between native and manual events This rephrase clarifies that what is async for native events is the dispatch process itself, _not_ the actual event handlers. Better phrasing after @dipikabh remark. --- files/en-us/web/api/eventtarget/dispatchevent/index.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/files/en-us/web/api/eventtarget/dispatchevent/index.md b/files/en-us/web/api/eventtarget/dispatchevent/index.md index 75e4a595ded4a1f..f4f8b6c52b2bab8 100644 --- a/files/en-us/web/api/eventtarget/dispatchevent/index.md +++ b/files/en-us/web/api/eventtarget/dispatchevent/index.md @@ -19,9 +19,7 @@ should have already been created and initialized using an {{domxref("Event/Event > [!NOTE] > When calling this method, the {{domxref("Event.target")}} property is initialized to the current `EventTarget`. -Unlike calling `dispatchEvent()` manually - "native" events, which are fired by the browser, schedule an asynchronous dispatch via the [event loop](/en-US/docs/Web/JavaScript/Reference/Execution_model). This dispatch uses the same process as `dispatchEvent()`. -`dispatchEvent()` invokes event handlers _synchronously_. All applicable event -handlers are called and return before `dispatchEvent()` returns. +Unlike calling `dispatchEvent()` manually, "native" events are fired by the browser and dispatched asynchronously via the [event loop](/en-US/docs/Web/JavaScript/Reference/Execution_model). The dispatch process itself is similar in both cases and invokes event handlers _synchronously_. All applicable event handlers are called and return before `dispatchEvent()` returns. ## Syntax