virtual-tree-canvas 0.7.3 → 0.7.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "virtual-tree-canvas",
3
- "version": "0.7.3",
3
+ "version": "0.7.4",
4
4
  "description": "High-performance Canvas2D virtual tree/table widget for very large hierarchical datasets.",
5
5
  "type": "module",
6
6
  "main": "./src/index.js",
@@ -45,9 +45,14 @@ export class TreeViewInputController {
45
45
  }
46
46
 
47
47
  #onWheel = (event) => {
48
- event.preventDefault();
49
48
  this.cellEditor?.close?.();
49
+ const { scrollX, scrollY } = this.controller.viewport;
50
50
  this.controller.scrollBy(event.shiftKey ? event.deltaY : event.deltaX, event.deltaY);
51
+ // Let the browser chain the wheel event to a scrollable ancestor when the
52
+ // tree has no room to move in the requested direction. This is essential
53
+ // for trees embedded in an accordion or other scrolling panel.
54
+ if (this.controller.viewport.scrollX !== scrollX || this.controller.viewport.scrollY !== scrollY)
55
+ event.preventDefault();
51
56
  };
52
57
 
53
58
  #onMouseMove = (event) => {