@ricsam/react-spreadsheets 0.0.12 → 0.0.13

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.
package/dist/cjs/lib.cjs CHANGED
@@ -3473,13 +3473,21 @@ class WorkbookSelectionManager {
3473
3473
  if (cachedSelections && manager.getState().selections.length === 0) {
3474
3474
  manager.replaceSelections(cachedSelections);
3475
3475
  }
3476
+ let previousFocus = manager.getState().hasFocus;
3477
+ let previousSelections = JSON.stringify(manager.getState().selections);
3476
3478
  const focusCleanup = manager.observeStateChange((state) => state.hasFocus, (hasFocus) => {
3479
+ if (hasFocus === previousFocus)
3480
+ return;
3481
+ previousFocus = hasFocus;
3477
3482
  if (hasFocus && !this.applyingRangeFocus.has(manager)) {
3478
3483
  this.rememberSelections(manager, registeredContext);
3479
3484
  this.emitChange();
3480
3485
  }
3481
3486
  });
3482
3487
  const selectionCleanup = manager.observeStateChange((state) => JSON.stringify(state.selections), (selectionsJson) => {
3488
+ if (selectionsJson === previousSelections)
3489
+ return;
3490
+ previousSelections = selectionsJson;
3483
3491
  if (this.applyingRangeFocus.has(manager))
3484
3492
  return;
3485
3493
  const selections = JSON.parse(selectionsJson);
@@ -4615,4 +4623,4 @@ var useClickAway = (ref, callback) => {
4615
4623
  }, [ref, callback]);
4616
4624
  };
4617
4625
 
4618
- //# debugId=95BAABDC3CCBBC2364756E2164756E21
4626
+ //# debugId=422BCC484554257364756E2164756E21