Skip to content

Commit 1d4e82c

Browse files
Filmbostock
andauthored
fix: pointer interaction was not always dispatching the new value (#1779)
* When simultaneously exiting a facet and entering a new one, prioritize dispatching the value from the entering facet. Fixes #1778 --------- Co-authored-by: Mike Bostock <[email protected]>
1 parent 4a80eb0 commit 1d4e82c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/interactions/pointer.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,10 @@ function pointerK(kx, ky, {x, y, px, py, maxRadius = 40, channels, render, ...op
123123
g.replaceWith(r);
124124
}
125125
state.roots[renderIndex] = g = r;
126-
context.dispatchValue(i == null ? null : data[i]);
126+
127+
// Dispatch the value. When simultaneously exiting this facet and
128+
// entering a new one, prioritize the entering facet.
129+
if (!(i == null && facetState?.size > 1)) context.dispatchValue(i == null ? null : data[i]);
127130
return r;
128131
}
129132

0 commit comments

Comments
 (0)