@window-splitter/state 1.1.3 → 1.1.4

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/esm/index.js CHANGED
@@ -873,7 +873,7 @@ function handleOverflow(context) {
873
873
  });
874
874
  const totalSize = pixelItems.reduce((acc, i) => acc.add(i), new Big(0));
875
875
  const overflow = totalSize.abs().sub(groupSize);
876
- if (overflow.eq(0) || groupSize.eq(0)) {
876
+ if (overflow.abs().lt(1) || groupSize.eq(0)) {
877
877
  return context;
878
878
  }
879
879
  let newContext = { ...context, items: prepareItems(context) };
@@ -1300,7 +1300,7 @@ export function groupMachine(input, onUpdate) {
1300
1300
  context.items = withLastKnownSize;
1301
1301
  }
1302
1302
  else if (totalSize > getGroupSize(context) &&
1303
- state.current !== "dragging") {
1303
+ state.current === "idle") {
1304
1304
  context.items = handleOverflow({
1305
1305
  ...context,
1306
1306
  items: prepareItems({ ...context, items: withLastKnownSize }),