@invopop/popui 0.1.98 → 0.1.99

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.
@@ -5,6 +5,16 @@
5
5
  import { SIDEBAR_DRAG_THRESHOLD_PX } from './constants.js'
6
6
  import { useSidebar } from './context.svelte.js'
7
7
 
8
+ function portal(node: HTMLElement) {
9
+ const target = typeof document !== 'undefined' ? document.body : null
10
+ if (target) target.appendChild(node)
11
+ return {
12
+ destroy() {
13
+ if (node.parentNode) node.parentNode.removeChild(node)
14
+ }
15
+ }
16
+ }
17
+
8
18
  let {
9
19
  ref = $bindable(null),
10
20
  class: className,
@@ -139,6 +149,7 @@
139
149
 
140
150
  {#if tooltipVisible}
141
151
  <div
152
+ use:portal
142
153
  role="tooltip"
143
154
  bind:offsetWidth={tooltipWidth}
144
155
  bind:offsetHeight={tooltipHeight}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@invopop/popui",
3
3
  "license": "MIT",
4
- "version": "0.1.98",
4
+ "version": "0.1.99",
5
5
  "repository": {
6
6
  "url": "https://github.com/invopop/popui"
7
7
  },