Skip to content

Commit

Permalink
fix: shift+mousewheel should scroll horizontally, fixes #1094 (#1096)
Browse files Browse the repository at this point in the history
  • Loading branch information
ghiscoding authored Jan 11, 2025
1 parent 8a8d3f4 commit 5003565
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/slick.grid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5405,8 +5405,12 @@ export class SlickGrid<TData = any, C extends Column<TData> = Column<TData>, O e

protected handleMouseWheel(e: MouseEvent, _delta: number, deltaX: number, deltaY: number) {
this.scrollHeight = this._viewportScrollContainerY.scrollHeight;
this.scrollTop = Math.max(0, this._viewportScrollContainerY.scrollTop - (deltaY * this._options.rowHeight!));
this.scrollLeft = this._viewportScrollContainerX.scrollLeft + (deltaX * 10);
if (e.shiftKey) {
this.scrollLeft = this._viewportScrollContainerX.scrollLeft + (deltaX * 10);
} else {
this.scrollTop = Math.max(0, this._viewportScrollContainerY.scrollTop - (deltaY * this._options.rowHeight!));
this.scrollLeft = this._viewportScrollContainerX.scrollLeft + (deltaX * 10);
}
const handled = this._handleScroll('mousewheel');
if (handled) {
e.preventDefault();
Expand Down

0 comments on commit 5003565

Please sign in to comment.