diff options
| author | dax <me@dax.ist> | 2026-08-04 08:54:52 +0000 |
|---|---|---|
| committer | dax <me@dax.ist> | 2026-08-04 08:54:52 +0000 |
| commit | 731f74670740ca6920a481fa276011bc87fc8f9c (patch) | |
| tree | e3d5ea53c5fc29f174cf4b9f91eceadc595dae21 | |
| parent | 51062d0579eba3c8137298a88963eb6aeb57c2e2 (diff) | |
pathways: ghost preview only shows on real pointer movement (pointermove, not pointerenter) - prevents phantom ghosts when keyboard navigation re-renders arrows/dropzones under a stationary mouse
| -rw-r--r-- | public/app.js | 4 | ||||
| -rw-r--r-- | public/index.html | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/public/app.js b/public/app.js index 98dcaed..c617e3a 100644 --- a/public/app.js +++ b/public/app.js @@ -213,7 +213,7 @@ function renderNav(id) { b.innerHTML = ARROW_SVG[ex.dir] b.addEventListener("pointerdown", (e) => e.stopPropagation()) b.addEventListener("click", (e) => { e.stopPropagation(); traverseFrom(id, ex.dir) }) - b.addEventListener("pointerenter", () => { + b.addEventListener("pointermove", () => { if (!adjacentTile(id, ex.dir)) showGhost(choosePlacement(id, ex.dir)) }) b.addEventListener("pointerleave", () => hideGhost()) @@ -371,7 +371,7 @@ function renderTileZones(id) { z.style.top = p.rect.y + "px" z.style.width = p.rect.w + "px" z.style.height = p.rect.h + "px" - z.addEventListener("pointerenter", () => showGhost(p)) + z.addEventListener("pointermove", () => showGhost(p)) z.addEventListener("pointerleave", () => hideGhost()) z.addEventListener("pointerdown", (e) => e.stopPropagation()) z.addEventListener("click", () => traverseFrom(id, dir)) diff --git a/public/index.html b/public/index.html index 1134334..a2dd33a 100644 --- a/public/index.html +++ b/public/index.html @@ -5,7 +5,7 @@ <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="color-scheme" content="dark"> <title>pathways</title> - <link rel="stylesheet" href="/app.css?v=10"> + <link rel="stylesheet" href="/app.css?v=11"> </head> <body> <main id="stage"> @@ -16,6 +16,6 @@ <p>four paths, one per direction. walk them.<br><span class="hint">drag or scroll to pan · pinch to zoom · double-click empty space or press 0 to fit</span></p> <button id="start">start</button> </div> - <script src="/app.js?v=10"></script> + <script src="/app.js?v=11"></script> </body> </html> |
