Skip to content

Commit

Permalink
Fix "Invalid value used as weak map key" error (T1186521)
Browse files Browse the repository at this point in the history
+ move test to other topic
  • Loading branch information
GoodDayForSurf committed Sep 1, 2023
1 parent b494f87 commit af9a1a0
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions packages/devextreme/js/events/core/events_engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit af9a1a0

Please sign in to comment.