@mmstack/primitives 21.6.0 → 21.6.1

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.
@@ -3597,7 +3597,7 @@ function createPointerDrag(opt) {
3597
3597
  return;
3598
3598
  const matched = handleSelector
3599
3599
  ? e.target?.closest?.(handleSelector)
3600
- : el;
3600
+ : (e.target ?? el); // no selector: the pressed element itself
3601
3601
  if (!matched)
3602
3602
  return; // handleSelector set but pointerdown landed outside a handle
3603
3603
  if (stopPropagation)
@@ -6056,6 +6056,7 @@ function tabSync(sig, opt) {
6056
6056
  }
6057
6057
  const NONE = Symbol();
6058
6058
  let received = NONE;
6059
+ let last = untracked(sig);
6059
6060
  const { unsub, post } = bus.subscribe(id, (next) => {
6060
6061
  const before = untracked(sig);
6061
6062
  received = next;
@@ -6063,13 +6064,12 @@ function tabSync(sig, opt) {
6063
6064
  if (untracked(sig) === before)
6064
6065
  received = NONE;
6065
6066
  });
6066
- let firstDone = false;
6067
6067
  const effectRef = effect(() => {
6068
6068
  const val = sig();
6069
- if (!firstDone) {
6070
- firstDone = true;
6071
- return;
6072
- }
6069
+ if (val === last)
6070
+ return; // unchanged since last seen → nothing to post
6071
+ last = val;
6072
+ // came from bus → don't echo
6073
6073
  if (val === received) {
6074
6074
  received = NONE;
6075
6075
  return;