Skip to content

Commit 56e2ecf

Browse files
committed
Disable wheel navigation in single page mode
1 parent 8079f7d commit 56e2ecf

File tree

2 files changed

+2
-17
lines changed

2 files changed

+2
-17
lines changed

cypress/e2e/single-mode.cy.ts

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,6 @@ describeAll("Test flip forge book", () => {
55
cy.viewport(414, 768);
66
});
77

8-
it("Check wheel navigation", () => {
9-
cy.get(".toolbar").contains("1 / 10");
10-
cy.get('[data-page="1"]').should("be.visible");
11-
cy.get("body").trigger("wheel", { deltaY: 120 });
12-
cy.get(".toolbar").contains("2 / 10");
13-
cy.get('[data-page="2"]').should("be.visible");
14-
15-
cy.get("body").trigger("wheel", { deltaY: 120 });
16-
cy.get(".toolbar").contains("3 / 10");
17-
cy.get('[data-page="3"]').should("be.visible");
18-
19-
cy.get("body").trigger("wheel", { deltaY: -120 });
20-
cy.get(".toolbar").contains("2 / 10");
21-
cy.get('[data-page="2"]').should("be.visible");
22-
});
23-
248
it("Check toolbar navigation", () => {
259
cy.get(".toolbar").contains("1 / 10");
2610
cy.get('[data-page="1"]').should("be.visible");

src/lib/flip-forge.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,8 @@ export default defineComponent({
336336
}
337337
},
338338
onWheel(event: WheelEvent) {
339-
if (!this.opts.wheelNavigation || !this.isLoaded) return;
339+
if (!this.opts.wheelNavigation || this.singlePageMode || !this.isLoaded)
340+
return;
340341
341342
if (event.deltaY > 0) {
342343
this.goNext();

0 commit comments

Comments
 (0)