Skip to content

Commit

Permalink
Disable wheel navigation in single page mode
Browse files Browse the repository at this point in the history
  • Loading branch information
alexkiro committed Nov 17, 2024
1 parent 8079f7d commit 56e2ecf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 17 deletions.
16 changes: 0 additions & 16 deletions cypress/e2e/single-mode.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,6 @@ describeAll("Test flip forge book", () => {
cy.viewport(414, 768);
});

it("Check wheel navigation", () => {
cy.get(".toolbar").contains("1 / 10");
cy.get('[data-page="1"]').should("be.visible");
cy.get("body").trigger("wheel", { deltaY: 120 });
cy.get(".toolbar").contains("2 / 10");
cy.get('[data-page="2"]').should("be.visible");

cy.get("body").trigger("wheel", { deltaY: 120 });
cy.get(".toolbar").contains("3 / 10");
cy.get('[data-page="3"]').should("be.visible");

cy.get("body").trigger("wheel", { deltaY: -120 });
cy.get(".toolbar").contains("2 / 10");
cy.get('[data-page="2"]').should("be.visible");
});

it("Check toolbar navigation", () => {
cy.get(".toolbar").contains("1 / 10");
cy.get('[data-page="1"]').should("be.visible");
Expand Down
3 changes: 2 additions & 1 deletion src/lib/flip-forge.vue
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,8 @@ export default defineComponent({
}
},
onWheel(event: WheelEvent) {
if (!this.opts.wheelNavigation || !this.isLoaded) return;
if (!this.opts.wheelNavigation || this.singlePageMode || !this.isLoaded)
return;
if (event.deltaY > 0) {
this.goNext();
Expand Down

0 comments on commit 56e2ecf

Please sign in to comment.