Skip to content

Commit

Permalink
Reduce max distance moved for long taps (#730)
Browse files Browse the repository at this point in the history
At 10 pixels, it was too easy to accidentally ping while dragging around
  • Loading branch information
sburba committed Aug 6, 2021
1 parent bc63842 commit 2aa12fc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion web/src/ui/util/useLongTap.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ it("does not trigger for drags", async () => {
const { getByText } = render(<LongTapTest onLongTap={cb} />);
const target = getByText("Touch Target");
await tap(target, { action: "down", pos: { x: 0, y: 0 } });
await fireEvent.pointerMove(target, {
fireEvent.pointerMove(target, {
pointerType: "touch",
isPrimary: true,
clientX: MAX_MOVE_LONG_TAP_PX + 1,
Expand Down
2 changes: 1 addition & 1 deletion web/src/ui/util/useLongTap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { assert } from "../../util/invariants";
import Pos2d, { distance } from "../../util/shape-math";

// Maximum distance in pixels your finger can move to still be considered a long tap
export const MAX_MOVE_LONG_TAP_PX = 10;
export const MAX_MOVE_LONG_TAP_PX = 5;
export const LONG_TAP_MS = 250;

interface State {
Expand Down

0 comments on commit 2aa12fc

Please sign in to comment.