From ed393f169e36d6a5b1e4c24404f42b6a49c4bf56 Mon Sep 17 00:00:00 2001 From: Cory LaViska Date: Mon, 14 Sep 2020 09:23:20 -0400 Subject: [PATCH] Fixes #210 --- CHANGELOG.md | 1 + src/components/tooltip/tooltip.tsx | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0719b274..259f1bc2 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 a1b44bbc..82f9a571 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); }