From af9a1a017203cff7ad029838fff6e2df44e8d2a1 Mon Sep 17 00:00:00 2001 From: Aliullov Vlad Date: Fri, 1 Sep 2023 17:21:21 +0400 Subject: [PATCH] Fix "Invalid value used as weak map key" error (T1186521) + move test to other topic --- packages/devextreme/js/events/core/events_engine.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/packages/devextreme/js/events/core/events_engine.js b/packages/devextreme/js/events/core/events_engine.js index d430cc257901..f89cb02dec6e 100644 --- a/packages/devextreme/js/events/core/events_engine.js +++ b/packages/devextreme/js/events/core/events_engine.js @@ -4,7 +4,7 @@ import domAdapter from '../../core/dom_adapter'; import { getWindow, hasWindow } from '../../core/utils/window'; const window = getWindow(); import injector from '../../core/utils/dependency_injector'; -import { isWindow, isFunction, isString } from '../../core/utils/type'; +import { isWindow, isFunction, isString, isObject } from '../../core/utils/type'; import Callbacks from '../../core/utils/callbacks'; import errors from '../../core/errors'; import hookTouchProps from '../../events/core/hook_touch_props'; @@ -114,10 +114,7 @@ const eventsEngine = injector({ const parents = []; const getParents = function(element) { const parent = element.parentNode - ?? (typeof element.host === 'object' - ? element.host - : null - ); + ?? (isObject(element.host) ? element.host : null); if(parent) { parents.push(parent); getParents(parent);