Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(web): mouse tilt wheel no longer switches threads on Windows and Linux desktop #32963

Mergedjuliusmarmingemerged 4 commits intomain fromrefs/pull/32963/headmerged by juliusmarminge View on GitHub

Showing 2 changed files with 19 additions and 2 deletions.

x
0 of 2 viewed, 2 left
13 additions and 0 deletionsapps/web/src/components/HistorySwipeNavigation.browser.test.tsxModified
View file
@@ -29,6 +29,7 @@
["a swipe that started in a closed dialog keeps the thread", "closed-dialog", 0, -130, false],
] as const)("%s", async (_name, scroller, scrollLeft, deltaX, navigates) => {
navigateHistory.mockReset();
+ using _platform = vi.spyOn(navigator, "platform", "get").mockReturnValue("MacIntel");
await using screen = await render(<HistorySwipeNavigation />);
const panel = screen.container.appendChild(document.createElement("div"));
const root = scroller.startsWith("shadow") ? panel.attachShadow({ mode: "open" }) : panel;
@@ -58,4 +59,16 @@
​
expect(navigateHistory).toHaveBeenCalledTimes(navigates ? 1 : 0);
});
+​
+ it("a horizontal mouse wheel tick off macOS keeps the thread", async () => {
+ navigateHistory.mockReset();
+ using _platform = vi.spyOn(navigator, "platform", "get").mockReturnValue("Win32");
+ await using screen = await render(<HistorySwipeNavigation />);
+ const content = screen.container.appendChild(document.createElement("div"));
+ content.style.cssText = "height: 20px; width: 100px";
+​
+ swipe(content, -120);
+​
+ expect(navigateHistory).not.toHaveBeenCalled();
+ });
});
6 additions and 2 deletionsapps/web/src/components/HistorySwipeNavigation.tsxModified
View file
@@ -1,7 +1,7 @@
import { ArrowLeftIcon, ArrowRightIcon } from "lucide-react";