From: Matthias Schmidt Date: Fri, 14 May 2021 05:40:13 +0000 (+0200) Subject: Fix condition in `Dependency/Manager.isHiddenByDependencies()` X-Git-Tag: 5.4.0_Alpha_3~38 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=dbeed1e34e809ddd9e8235d02233e97214495a2a;p=GitHub%2FWoltLab%2FWCF.git 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. --- 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; } });