Skip to content

Commit

Permalink
Don't prevent table scrolling
Browse files Browse the repository at this point in the history
  • Loading branch information
AbeJellinek committed Aug 15, 2023
1 parent b76e76f commit 79cc60c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/dom/epub/flow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ export class PaginatedFlow extends AbstractFlow {
this._iframeDocument.body.addEventListener('touchstart', this._handleTouchStart);
this._iframeDocument.body.addEventListener('touchmove', this._handleTouchMove);
this._iframeDocument.body.addEventListener('touchend', this._handleTouchEnd);
this._iframeDocument.addEventListener('wheel', this._handleWheel, { passive: true });
this._iframeDocument.addEventListener('wheel', this._handleWheel, { passive: false });
this._resizeObserver = new ResizeObserver(this._handleTableResize);
this._iframe.classList.add('flow-mode-paginated');
this._iframeDocument.body.classList.add('flow-mode-paginated');
Expand Down Expand Up @@ -577,6 +577,10 @@ export class PaginatedFlow extends AbstractFlow {
};

private _handleWheel = debounce((event: WheelEvent) => {
let tableParent = (event.target as Element).closest('.table-child-could-overflow');
if (tableParent && tableParent.clientHeight < tableParent.scrollHeight) {
return;
}
if (event.deltaY < 0) {
this.navigateToPreviousPage();
event.preventDefault();
Expand Down

0 comments on commit 79cc60c

Please sign in to comment.