diff --git a/packages/webawesome/docs/docs/resources/changelog.md b/packages/webawesome/docs/docs/resources/changelog.md index 1fbfbe6a5..5549e7659 100644 --- a/packages/webawesome/docs/docs/resources/changelog.md +++ b/packages/webawesome/docs/docs/resources/changelog.md @@ -30,10 +30,11 @@ Components with the Experimental badge sh - Fixed a bug in `` where its value would revert to `""` when checked / unchecked [pr:1547] - Fixed a bug that caused icon button labels to not render in frameworks [issue:1542] - Fixed a bug in `` that caused the `name` property not to reflect [pr:1538] -- Modified `` to only show the tooltip on the handle being dragged when in range mode [issue:1320] - Fixed a bug in `` and `` that prevented focus from being set on the dialog/drawer when opened [issue:1302] - Fixed an overflow style that was causing tab group content to be unnecessarily truncated [issue:1401] - Fixed a bug in `` that caused icon buttons to render when non-text nodes were slotted in [issue:1475] +- Fixed a bug in `` that prevented tooltips from showing when disconnecting and then reconnecting to the DOM [issue:1595] +- Modified `` to only show the tooltip on the handle being dragged when in range mode [issue:1320] ## 3.0.0-beta.6 @@ -477,4 +478,4 @@ Many of these changes and improvements were the direct result of feedback from u -Did we miss something? [Let us know!](https://github.com/shoelace-style/webawesome/discussions) \ No newline at end of file +Did we miss something? [Let us know!](https://github.com/shoelace-style/webawesome/discussions) diff --git a/packages/webawesome/src/components/tooltip/tooltip.ts b/packages/webawesome/src/components/tooltip/tooltip.ts index e4c103d94..9c16798c5 100644 --- a/packages/webawesome/src/components/tooltip/tooltip.ts +++ b/packages/webawesome/src/components/tooltip/tooltip.ts @@ -101,6 +101,11 @@ export default class WaTooltip extends WebAwesomeElement { connectedCallback() { super.connectedCallback(); + // Recreate event controller if it was aborted + if (this.eventController.signal.aborted) { + this.eventController = new AbortController(); + } + // TODO: This is a hack that I need to revisit [Konnor] if (this.open) { this.open = false; @@ -113,6 +118,15 @@ export default class WaTooltip extends WebAwesomeElement { if (!this.id) { this.id = uniqueId('wa-tooltip-'); } + + // Re-establish anchor connection after being disconnected + if (this.for && this.anchor) { + this.anchor = null; // force reattach + this.handleForChange(); + } else if (this.for) { + // Initial connection + this.handleForChange(); + } } disconnectedCallback() {