From dbeed1e34e809ddd9e8235d02233e97214495a2a Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Fri, 14 May 2021 07:40:13 +0200 Subject: [PATCH] Fix condition in `Dependency/Manager.isHiddenByDependencies()` The checked node is considered hidden, if it (`node`) is in a hidden node (`hiddenNode`) . The variables were mixed up in this condition during the transition to TypeScript. --- ts/WoltLabSuite/Core/Form/Builder/Field/Dependency/Manager.ts | 2 +- .../WoltLabSuite/Core/Form/Builder/Field/Dependency/Manager.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ts/WoltLabSuite/Core/Form/Builder/Field/Dependency/Manager.ts b/ts/WoltLabSuite/Core/Form/Builder/Field/Dependency/Manager.ts index 7effcac1c3..e005d02ec6 100644 --- a/ts/WoltLabSuite/Core/Form/Builder/Field/Dependency/Manager.ts +++ b/ts/WoltLabSuite/Core/Form/Builder/Field/Dependency/Manager.ts @@ -235,7 +235,7 @@ export function isHiddenByDependencies(node: HTMLElement): boolean { let returnValue = false; _dependencyHiddenNodes.forEach((hiddenNode) => { - if (node.contains(hiddenNode)) { + if (hiddenNode.contains(node)) { returnValue = true; } }); diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Form/Builder/Field/Dependency/Manager.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Form/Builder/Field/Dependency/Manager.js index 66057c8e29..0e3502e1d7 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Form/Builder/Field/Dependency/Manager.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Form/Builder/Field/Dependency/Manager.js @@ -201,7 +201,7 @@ define(["require", "exports", "tslib", "../../../../Dom/Util", "../../../../Even } let returnValue = false; _dependencyHiddenNodes.forEach((hiddenNode) => { - if (node.contains(hiddenNode)) { + if (hiddenNode.contains(node)) { returnValue = true; } }); -- 2.20.1