Skip to content

Commit

Permalink
Fix(web): Check if controlled placement on Tooltip is also undefined
Browse files Browse the repository at this point in the history
  * advanced floating functionality was applied on all tooltips with
    data-spirit-toggle="tooltip"
  • Loading branch information
literat authored and pavelklibani committed Jan 30, 2024
1 parent 9fc6ae0 commit 049ebf7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/web/src/js/Tooltip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<Config>) {
Expand Down

0 comments on commit 049ebf7

Please sign in to comment.