From 1f6677b8dc3f8a90bce259e8a4f5c63207774e1d 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 9a7d0a2782..8eaaa9a358 100644 --- a/packages/web/src/js/Tooltip.ts +++ b/packages/web/src/js/Tooltip.ts @@ -84,9 +84,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) {