@nectary/components 5.53.1 → 5.53.2

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/bundle.js CHANGED
@@ -3807,6 +3807,7 @@ class Tooltip extends NectaryElement {
3807
3807
  updateBooleanAttribute(this.#$pop, "disable-focus-restore", true);
3808
3808
  this.#updatePopA11yAttrs();
3809
3809
  this.#updateText();
3810
+ this.#restoreControlledOpen();
3810
3811
  }
3811
3812
  disconnectedCallback() {
3812
3813
  super.disconnectedCallback();
@@ -4588,6 +4589,20 @@ class Tooltip extends NectaryElement {
4588
4589
  #isOpen() {
4589
4590
  return this.#$pop.hasAttribute("open");
4590
4591
  }
4592
+ // `is-opened` can be set before the element is connected (e.g. React 19 reveals a
4593
+ // Suspense boundary later): the pop opened, but the reveal was dropped while
4594
+ // disconnected. Disconnecting also hides the tooltip, so reapply `is-opened` on reconnect.
4595
+ #restoreControlledOpen() {
4596
+ if (this.isOpenedControlled !== true) {
4597
+ return;
4598
+ }
4599
+ if (this.#isOpen()) {
4600
+ this.#schedulePlacement();
4601
+ this.#scheduleReveal(++this.#revealRequestId);
4602
+ } else {
4603
+ this.#tooltipState.show();
4604
+ }
4605
+ }
4591
4606
  #dispatchShowEvent() {
4592
4607
  this.dispatchEvent(new CustomEvent("-show"));
4593
4608
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nectary/components",
3
- "version": "5.53.1",
3
+ "version": "5.53.2",
4
4
  "files": [
5
5
  "**/*/*.css",
6
6
  "**/*/*.json",
package/tooltip/index.js CHANGED
@@ -124,6 +124,7 @@ class Tooltip extends NectaryElement {
124
124
  updateBooleanAttribute(this.#$pop, "disable-focus-restore", true);
125
125
  this.#updatePopA11yAttrs();
126
126
  this.#updateText();
127
+ this.#restoreControlledOpen();
127
128
  }
128
129
  disconnectedCallback() {
129
130
  super.disconnectedCallback();
@@ -905,6 +906,20 @@ class Tooltip extends NectaryElement {
905
906
  #isOpen() {
906
907
  return this.#$pop.hasAttribute("open");
907
908
  }
909
+ // `is-opened` can be set before the element is connected (e.g. React 19 reveals a
910
+ // Suspense boundary later): the pop opened, but the reveal was dropped while
911
+ // disconnected. Disconnecting also hides the tooltip, so reapply `is-opened` on reconnect.
912
+ #restoreControlledOpen() {
913
+ if (this.isOpenedControlled !== true) {
914
+ return;
915
+ }
916
+ if (this.#isOpen()) {
917
+ this.#schedulePlacement();
918
+ this.#scheduleReveal(++this.#revealRequestId);
919
+ } else {
920
+ this.#tooltipState.show();
921
+ }
922
+ }
908
923
  #dispatchShowEvent() {
909
924
  this.dispatchEvent(new CustomEvent("-show"));
910
925
  }