@descope-ui/descope-tooltip 3.13.1 → 3.13.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@descope-ui/descope-tooltip",
3
- "version": "3.13.1",
3
+ "version": "3.13.3",
4
4
  "files": [
5
5
  "src",
6
6
  "stories"
@@ -18,14 +18,14 @@
18
18
  },
19
19
  "devDependencies": {
20
20
  "@playwright/test": "1.58.2",
21
- "e2e-utils": "3.13.1"
21
+ "e2e-utils": "3.13.3"
22
22
  },
23
23
  "dependencies": {
24
24
  "@vaadin/tooltip": "24.3.4",
25
- "@descope-ui/common": "3.13.1",
26
- "@descope-ui/theme-globals": "3.13.1",
27
- "@descope-ui/descope-enriched-text": "3.13.1",
28
- "@descope-ui/descope-anchored": "3.13.1"
25
+ "@descope-ui/theme-globals": "3.13.3",
26
+ "@descope-ui/descope-enriched-text": "3.13.3",
27
+ "@descope-ui/common": "3.13.3",
28
+ "@descope-ui/descope-anchored": "3.13.3"
29
29
  },
30
30
  "publishConfig": {
31
31
  "link-workspace-packages": false
@@ -7,6 +7,7 @@ import {
7
7
  forwardAttrs,
8
8
  getComponentName,
9
9
  injectStyle,
10
+ observeAttributes,
10
11
  } from '@descope-ui/common/components-helpers';
11
12
  import { createBaseClass } from '@descope-ui/common/base-classes';
12
13
  import { EnrichedTextClass } from '@descope-ui/descope-enriched-text/class';
@@ -25,6 +26,11 @@ class RawTooltip extends createBaseClass({
25
26
  componentName,
26
27
  baseSelector: 'vaadin-tooltip',
27
28
  }) {
29
+ // Observes the inner descope-anchored's `class` attribute so runtime updates
30
+ // (e.g. real-time conditional components toggling `.hidden`) keep this
31
+ // tooltip's class in sync. Set up in connectedCallback so reconnects work.
32
+ #anchoredClassObserver = null;
33
+
28
34
  constructor() {
29
35
  super();
30
36
 
@@ -140,9 +146,31 @@ class RawTooltip extends createBaseClass({
140
146
  );
141
147
  this.#setTooltipTarget();
142
148
 
149
+ setTimeout(() => this.#onOverlayReady());
150
+ }
151
+
152
+ #observeAnchored() {
153
+ this.#anchoredClassObserver?.disconnect();
154
+ if (this.anchored) {
155
+ this.#anchoredClassObserver = observeAttributes(
156
+ this.anchored,
157
+ () => this.#syncComponentState(),
158
+ { includeAttrs: ['class'] },
159
+ );
160
+ }
161
+ }
162
+
163
+ // createBaseClass gates init() to first-connect, so observing here is
164
+ // required for the detach/reattach cycle to keep working.
165
+ connectedCallback() {
166
+ super.connectedCallback?.();
143
167
  this.#syncComponentState();
168
+ this.#observeAnchored();
169
+ }
144
170
 
145
- setTimeout(() => this.#onOverlayReady());
171
+ disconnectedCallback() {
172
+ super.disconnectedCallback?.();
173
+ this.#anchoredClassObserver?.disconnect();
146
174
  }
147
175
 
148
176
  #setTooltipTarget() {