@intechstudio/grid-uikit 1.20260922.1158 → 1.20260922.1223

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.
@@ -21,7 +21,6 @@
21
21
 
22
22
  let showbuttons = $state(false);
23
23
  let showTooltip = $state(false);
24
- let tooltipKey = $state(0);
25
24
  let popperInstance: any = $state();
26
25
 
27
26
  // Popper computes its position/flip-away-from-edge decision once, when
@@ -86,7 +85,13 @@
86
85
  }
87
86
  if (triggerEvents.includes("show-buttons")) {
88
87
  clearTimeout(openTimeout);
89
- tooltipKey++;
88
+ // Show buttons on the existing (already-positioned) popover. Do NOT
89
+ // recreate the Popover here: recreating it while it is already open
90
+ // (e.g. hover opened it first) mounts the new instance with isOpen
91
+ // already true, and popper fails to attach — the surface then renders
92
+ // in-tree next to the reference instead of absolutely positioned. The
93
+ // $effect below calls popperInstance.update() to reposition for the
94
+ // taller buttons content.
90
95
  showTooltip = true;
91
96
  if (buttons.length > 0) {
92
97
  showbuttons = true;
@@ -271,81 +276,79 @@
271
276
  }
272
277
  </script>
273
278
 
274
- {#key tooltipKey}
275
- <Popover
276
- isOpen={showTooltip}
277
- triggerEvents={["manual"]}
278
- {referenceElement}
279
- bind:placement
280
- bind:popperInstance
281
- spaceAway={10}
279
+ <Popover
280
+ isOpen={showTooltip}
281
+ triggerEvents={["manual"]}
282
+ {referenceElement}
283
+ bind:placement
284
+ bind:popperInstance
285
+ spaceAway={10}
286
+ >
287
+ <!-- svelte-ignore a11y-click-events-have-key-events -->
288
+ <!-- svelte-ignore a11y-no-static-element-interactions -->
289
+ <div
290
+ on:mouseenter={handleMouseEnter}
291
+ on:mouseleave={handleMouseLeave}
292
+ on:click={handleClick}
293
+ bind:this={tooltipElement}
294
+ tabindex="-1"
295
+ class="{className} tooltip-container"
296
+ transition:fade|global={{
297
+ duration: instant ? 0 : duration, //Make it instant when explicitly clicked
298
+ }}
282
299
  >
283
- <!-- svelte-ignore a11y-click-events-have-key-events -->
284
- <!-- svelte-ignore a11y-no-static-element-interactions -->
285
300
  <div
286
- on:mouseenter={handleMouseEnter}
287
- on:mouseleave={handleMouseLeave}
288
- on:click={handleClick}
289
- bind:this={tooltipElement}
290
- tabindex="-1"
291
- class="{className} tooltip-container"
292
- transition:fade|global={{
293
- duration: instant ? 0 : duration, //Make it instant when explicitly clicked
294
- }}
301
+ class="tooltip-container-content"
302
+ class:tooltip-gap-2={buttons.length > 0}
295
303
  >
296
- <div
297
- class="tooltip-container-content"
298
- class:tooltip-gap-2={buttons.length > 0}
299
- >
300
- {#if typeof component === "undefined"}
301
- <div
302
- class="tooltip-container-text"
303
- class:tooltip-whitespace-nowrap={nowrap}
304
- >
305
- {showbuttons && extendedText !== undefined ? extendedText : text}
306
- </div>
307
- {:else}
308
- <svelte:component
309
- this={component.object}
310
- {...component.props}
311
- class="tooltip-container-component"
312
- on:event={interceptEvent}
313
- />
314
- {/if}
315
-
316
- {#if showbuttons}
317
- <div
318
- transition:fade|global={{ duration: instant ? 0 : 100 }}
319
- class="tooltip-container-buttons"
320
- >
321
- {#each buttons as button}
322
- <MoltenPushButton
323
- text={button.label}
324
- snap={"full"}
325
- click={() => {
326
- if (typeof button.handler !== "undefined") {
327
- button.handler();
328
- }
329
- close();
330
- }}
331
- />
332
- {/each}
333
- </div>
334
- {/if}
335
- </div>
304
+ {#if typeof component === "undefined"}
305
+ <div
306
+ class="tooltip-container-text"
307
+ class:tooltip-whitespace-nowrap={nowrap}
308
+ >
309
+ {showbuttons && extendedText !== undefined ? extendedText : text}
310
+ </div>
311
+ {:else}
312
+ <svelte:component
313
+ this={component.object}
314
+ {...component.props}
315
+ class="tooltip-container-component"
316
+ on:event={interceptEvent}
317
+ />
318
+ {/if}
319
+
320
+ {#if showbuttons}
321
+ <div
322
+ transition:fade|global={{ duration: instant ? 0 : 100 }}
323
+ class="tooltip-container-buttons"
324
+ >
325
+ {#each buttons as button}
326
+ <MoltenPushButton
327
+ text={button.label}
328
+ snap={"full"}
329
+ click={() => {
330
+ if (typeof button.handler !== "undefined") {
331
+ button.handler();
332
+ }
333
+ close();
334
+ }}
335
+ />
336
+ {/each}
337
+ </div>
338
+ {/if}
336
339
  </div>
337
- <div
338
- transition:fade|global={{
339
- duration: instant ? 0 : duration,
340
- }}
341
- class="tooltip-absolute"
342
- id="arrow"
343
- data-popper-arrow
344
- >
345
- <div class="tooltip-absolute" id="arrow_face" />
346
- </div>
347
- </Popover>
348
- {/key}
340
+ </div>
341
+ <div
342
+ transition:fade|global={{
343
+ duration: instant ? 0 : duration,
344
+ }}
345
+ class="tooltip-absolute"
346
+ id="arrow"
347
+ data-popper-arrow
348
+ >
349
+ <div class="tooltip-absolute" id="arrow_face" />
350
+ </div>
351
+ </Popover>
349
352
 
350
353
  <style>
351
354
  div.tooltip-container {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intechstudio/grid-uikit",
3
- "version": "1.20260922.1158",
3
+ "version": "1.20260922.1223",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/intechstudio/grid-uikit.git"