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 committed Jan 26, 2024
1 parent 5038ce1 commit 59f4252
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 @@ -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<Config>) {
Expand Down

0 comments on commit 59f4252

Please sign in to comment.