pivotkit-react 0.8.1 → 0.8.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.
package/CHANGELOG.md CHANGED
@@ -6,6 +6,14 @@ All notable changes to `pivotkit-react` are documented in this file. The format
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.8.2] - 2026-11-19
10
+
11
+ ### Fixed
12
+
13
+ - The arrow keys in a long table no longer leave the focus one cell behind. When the table scrolled
14
+ between two key presses, the focus could stay on the cell before the one the keys moved to, and
15
+ the status line named that row ([#416](https://github.com/eizedev/pivotkit/issues/416)).
16
+
9
17
  ## [0.8.1] - 2026-11-18
10
18
 
11
19
  ### Added
@@ -1281,7 +1289,8 @@ First release.
1281
1289
  weather (Open-Meteo), countries (World Bank), earthquakes (USGS), Nobel laureates and the release
1282
1290
  cycles of software products (endoflife.date).
1283
1291
 
1284
- [Unreleased]: https://github.com/eizedev/pivotkit/compare/pivotkit-react@0.8.1...HEAD
1292
+ [Unreleased]: https://github.com/eizedev/pivotkit/compare/pivotkit-react@0.8.2...HEAD
1293
+ [0.8.2]: https://github.com/eizedev/pivotkit/compare/pivotkit-react@0.8.1...pivotkit-react@0.8.2
1285
1294
  [0.8.1]: https://github.com/eizedev/pivotkit/compare/pivotkit-react@0.8.0...pivotkit-react@0.8.1
1286
1295
  [0.8.0]: https://github.com/eizedev/pivotkit/compare/pivotkit-react@0.7.0...pivotkit-react@0.8.0
1287
1296
  [0.7.0]: https://github.com/eizedev/pivotkit/compare/pivotkit-react@0.6.1...pivotkit-react@0.7.0
package/dist/index.js CHANGED
@@ -1228,7 +1228,10 @@ function PivotTable({ grid, view, labels, onToggle: toggleGroup, onCell, version
1228
1228
  []
1229
1229
  );
1230
1230
  const fixedWidths = virtual && labelsWide?.grid === grid ? labelsWide.widths : null;
1231
- const focusNext = useRef4(false);
1231
+ const focusNext = useRef4(
1232
+ /** @type {{ r: number, c: number } | null} */
1233
+ null
1234
+ );
1232
1235
  const [sortNote, setSortNote] = useState5("");
1233
1236
  const focusToggle = useRef4(
1234
1237
  /** @type {string | null} */
@@ -1381,7 +1384,7 @@ function PivotTable({ grid, view, labels, onToggle: toggleGroup, onCell, version
1381
1384
  if (!valueAt(r, c)) {
1382
1385
  return;
1383
1386
  }
1384
- focusNext.current = true;
1387
+ focusNext.current = { r, c };
1385
1388
  setActive({ r, c });
1386
1389
  const el = wrap.current;
1387
1390
  if (virtual && el) {
@@ -1398,10 +1401,16 @@ function PivotTable({ grid, view, labels, onToggle: toggleGroup, onCell, version
1398
1401
  const button = [...table.current.querySelectorAll("button[data-pk-toggle]")].find((b) => b.getAttribute("data-pk-toggle") === key);
1399
1402
  button?.focus({ preventScroll: true });
1400
1403
  }
1401
- if (focusNext.current && current) {
1402
- focusNext.current = false;
1403
- const td = table.current?.querySelector(`td[data-r="${current.r}"][data-c="${current.c}"]`);
1404
- td?.focus({ preventScroll: false });
1404
+ const next = focusNext.current;
1405
+ if (next && current && current.r === next.r && current.c === next.c) {
1406
+ const td = (
1407
+ /** @type {HTMLElement | null} */
1408
+ table.current?.querySelector(`td[data-r="${current.r}"][data-c="${current.c}"]`)
1409
+ );
1410
+ if (td) {
1411
+ focusNext.current = null;
1412
+ td.focus({ preventScroll: false });
1413
+ }
1405
1414
  }
1406
1415
  });
1407
1416
  const onKeyDown = (e) => {
package/dist/menus.js CHANGED
@@ -3335,7 +3335,7 @@ async function copyImage(blob, env = { clipboard: typeof navigator !== "undefine
3335
3335
  }
3336
3336
 
3337
3337
  // src/version.js
3338
- var VERSION = true ? "0.8.1" : "0.0.0-source";
3338
+ var VERSION = true ? "0.8.2" : "0.0.0-source";
3339
3339
 
3340
3340
  // src/share-actions.js
3341
3341
  var here = () => typeof location !== "undefined" ? location.href : void 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pivotkit-react",
3
- "version": "0.8.1",
3
+ "version": "0.8.2",
4
4
  "description": "React 18/19 pivot report builder on pivotkit-core: drag-and-drop fields, table and Apache ECharts chart, filters, views as JSON files, undo, Excel and CSV export.",
5
5
  "license": "MIT",
6
6
  "author": "eizedev <oss@eize.dev>",