Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/common/src/core/__tests__/slickGrid.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6116,6 +6116,7 @@ describe('SlickGrid core file', () => {

const mouseEvent = new Event('mousewheel');
const mousePreventSpy = vi.spyOn(mouseEvent, 'stopPropagation');
const nativeScrollPreventSpy = vi.spyOn(mouseEvent, 'preventDefault');
const onViewportChangedSpy = vi.spyOn(grid.onViewportChanged, 'notify');
const viewportBottomRightElm = container.querySelector('.slick-viewport-bottom.slick-viewport-right') as HTMLDivElement;
Object.defineProperty(viewportBottomRightElm, 'scrollHeight', { writable: true, value: DEFAULT_GRID_HEIGHT });
Expand All @@ -6136,6 +6137,7 @@ describe('SlickGrid core file', () => {
expect(viewportBottomRightElm.scrollTop).toBe(0);
expect(onViewportChangedSpy).toHaveBeenCalled();
expect(mousePreventSpy).toHaveBeenCalled();
expect(nativeScrollPreventSpy).toHaveBeenCalled();
});

it('should scroll all elements shown when triggered by mousewheel and preHeader/footer/frozenColumn are enabled', () => {
Expand Down
7 changes: 7 additions & 0 deletions packages/common/src/core/slickGrid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6318,6 +6318,13 @@ export class SlickGrid<TData = any, C extends Column<TData> = Column<TData>, O e
const handled = this._handleScroll('mousewheel');
if (handled) {
e.stopPropagation();
// Frozen columns use a second viewport whose vertical position is mirrored
// from the scrolling pane. Letting the browser also process this wheel event
// advances the source pane a second time, briefly putting it ahead of the
// frozen viewport until its subsequent scroll event is handled.
if (this.hasFrozenColumns()) {
e.preventDefault();
}
}
}

Expand Down
Loading