From c8d36ea52dbef0a2e1aaec6aedaf7edd524975dc Mon Sep 17 00:00:00 2001 From: Johannes Eder Date: Mon, 30 Aug 2021 11:32:24 +0200 Subject: [PATCH] fix(tooltips): correct regex match --- frontend/src/utils/tooltips/tooltips.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/frontend/src/utils/tooltips/tooltips.js b/frontend/src/utils/tooltips/tooltips.js index ba32bab9e..99b144f7e 100644 --- a/frontend/src/utils/tooltips/tooltips.js +++ b/frontend/src/utils/tooltips/tooltips.js @@ -191,9 +191,7 @@ export class Tooltip { destroy() { this._eventManager.cleanUp(); this._movementObserver.unobserve(); - for (let i = 0; i < this._element.classList.length; i++) { - if (/tooltip--*/.test(this._element.classList[i])) - this._element.classList.remove(this._element.classList.item(i)); - } + const toolTipsRegex = RegExp(/\btooltip--.+\b/, 'g'); + this._element.className = this._element.className.replace(toolTipsRegex, ''); } };