From 89f7ebc6dcafe725a3223f04bbefa1f3d7af798c Mon Sep 17 00:00:00 2001 From: literat Date: Thu, 25 Jan 2024 18:31:55 +0100 Subject: [PATCH] Fix(web): Check if controlled placement on Tooltip is also undefined * advanced floating functionality was applied on all tooltips with data-spirit-toggle="tooltip" --- packages/web/src/js/Tooltip.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/web/src/js/Tooltip.ts b/packages/web/src/js/Tooltip.ts index b64042b938..4eb5b17c6f 100644 --- a/packages/web/src/js/Tooltip.ts +++ b/packages/web/src/js/Tooltip.ts @@ -82,9 +82,11 @@ class Tooltip extends BaseComponent { } isPlacementControlled() { - const { placementControlled } = this.config as Config; + const config = this.config as Config; + const placementControlledKey = 'placementControlled'; - return placementControlled !== false; + // key can exist in the dataset but can have undefined value + return placementControlledKey in config && config[placementControlledKey] !== false; } updateConfig(newConfig: Partial) {