@human-kit/ui 1.0.0-beta.10 → 1.0.0-beta.11

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,13 +21,7 @@
21
21
  shouldSkipDelay,
22
22
  unregisterOpenTooltip
23
23
  } from './tooltip-group';
24
- import {
25
- buildSafePolygon,
26
- isPointInPolygon,
27
- isPointInRect,
28
- type Point,
29
- type Side
30
- } from './safe-polygon';
24
+ import { buildSafePolygon, isPointInPolygon, type Point, type Side } from './safe-polygon';
31
25
 
32
26
  /**
33
27
  * Tooltip.Root — the open state, the delays, and the interaction with the trigger.
@@ -256,8 +250,12 @@
256
250
  function handleGapPointerMove(event: PointerEvent) {
257
251
  if (!gapPolygon) return;
258
252
  const point = { x: event.clientX, y: event.clientY };
259
- const onContent = contentRef ? isPointInRect(point, contentRef.getBoundingClientRect()) : false;
260
- const onTrigger = triggerRef ? isPointInRect(point, triggerRef.getBoundingClientRect()) : false;
253
+ // What the pointer is on, as the browser hit-tests it, not the bounding box: the corner of a
254
+ // rounded panel is inside its box but not on it, and no `pointerenter` comes from there to
255
+ // take over — tracking stopped on it left the tooltip open for good.
256
+ const target = event.target instanceof Node ? event.target : null;
257
+ const onContent = target !== null && (contentRef?.contains(target) ?? false);
258
+ const onTrigger = target !== null && (triggerRef?.contains(target) ?? false);
261
259
  if (onContent || onTrigger) {
262
260
  // The `pointerenter` of the content or the trigger takes over from here.
263
261
  stopGapTracking();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@human-kit/ui",
3
- "version": "1.0.0-beta.10",
3
+ "version": "1.0.0-beta.11",
4
4
  "description": "Accessible, typed UI components for Svelte 5 — shipped as native ESM with per-component subpath exports so bundlers only include what you import.",
5
5
  "license": "MIT",
6
6
  "author": "Agustin Delgado <agustindariodelgado@gmail.com>",