diff --git a/CHANGELOG.md b/CHANGELOG.md index 0719b274c..259f1bc20 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ - Added `input`, `label`, `prefix`, `clear-button`, `suffix`, `help-text` exported parts to `sl-select` to make the input customizable - Fixed a bug where mouse events would bubble up when `sl-button` was disabled, causing tooltips to erroneously appear - Fixed a bug where pressing space would open and immediately close `sl-dropdown` panels in Firefox +- Fixed a bug where `sl-tooltip` would throw an error on init - Fixed buggy custom keyframes animation example - Refactored clear logic in `sl-input` diff --git a/src/components/tooltip/tooltip.tsx b/src/components/tooltip/tooltip.tsx index a1b44bbce..82f9a5716 100644 --- a/src/components/tooltip/tooltip.tsx +++ b/src/components/tooltip/tooltip.tsx @@ -202,7 +202,7 @@ export class Tooltip { const oldTarget = this.target; const newTarget = this.getTarget(); - if (newTarget !== oldTarget) { + if (oldTarget && newTarget !== oldTarget) { oldTarget.removeAttribute('aria-describedby'); newTarget.setAttribute('aria-describedby', this.componentId); }