@homebound/beam 2.157.1 → 2.157.2

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.
@@ -23,7 +23,10 @@ function sortBatch(columns, batch, sortState, caseSensitive) {
23
23
  const primaryColumn = primaryKey && columns[primaryKey];
24
24
  // Make a shallow copy for sorting to avoid mutating the original list
25
25
  return [...batch].sort((a, b) => {
26
- if ((a.pin || b.pin) && !(a.pin === b.pin)) {
26
+ if (a.pin || b.pin) {
27
+ // If both rows are pinned, we don't sort within them, because by pinning the page is taking
28
+ // explicit ownership over the order of the rows (and we also don't support "levels of pins",
29
+ // i.e. for change events putting "just added" rows `pin: last` and the "add new" row `pin: lastest`).
27
30
  const ap = a.pin === "first" ? -1 : a.pin === "last" ? 1 : 0;
28
31
  const bp = b.pin === "first" ? -1 : b.pin === "last" ? 1 : 0;
29
32
  return ap === bp ? 0 : ap < bp ? -1 : 1;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@homebound/beam",
3
- "version": "2.157.1",
3
+ "version": "2.157.2",
4
4
  "author": "Homebound",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",