From 250e55b0d98d0855ede51ca6245cecd559b299ed Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Thu, 20 Sep 2018 22:43:44 +0200 Subject: [PATCH] Ensure that all event properties are included, even if no (internal) listeners are registered, when re-dispatching events to the DOM (PR 10019 follow-up) --- web/ui_utils.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/web/ui_utils.js b/web/ui_utils.js index d0e59d58d..c0c11f277 100644 --- a/web/ui_utils.js +++ b/web/ui_utils.js @@ -708,12 +708,13 @@ class EventBus { let eventListeners = this._listeners[eventName]; if (!eventListeners || eventListeners.length === 0) { if (this._dispatchToDOM) { - this._dispatchDOMEvent(eventName); + const args = Array.prototype.slice.call(arguments, 1); + this._dispatchDOMEvent(eventName, args); } return; } // Passing all arguments after the eventName to the listeners. - let args = Array.prototype.slice.call(arguments, 1); + const args = Array.prototype.slice.call(arguments, 1); // Making copy of the listeners array in case if it will be modified // during dispatch. eventListeners.slice(0).forEach(function (listener) {