Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

Update filter-select.tsx

Tim Wilson9918a2255d52
diff --git a/packages/ui/src/filter/filter-select.tsx b/packages/ui/src/filter/filter-select.tsx
index c7dc133a5f..d32c6b598c 100644
--- a/packages/ui/src/filter/filter-select.tsx
+++ b/packages/ui/src/filter/filter-select.tsx
@@ -347,6 +347,8 @@ function FilterButton({
right?: ReactNode;
onSelect: () => void;
}) {
+ const { isMobile } = useMediaQuery();
+
const Icon = option
? option.icon ??
filter.getOptionIcon?.(option.value, { key: filter.key, option }) ??
@@ -368,7 +370,10 @@ function FilterButton({
e.preventDefault();
}}
onPointerUp={(e) => {
- onSelect();
+ e.preventDefault();
+ // Mobile touches have some sort of delay that can cause the next page's option's
+ // onClick / onSelect to be triggered so we delay this by 100ms to account for it
+ isMobile ? setTimeout(onSelect, 100) : onSelect();
}}
onSelect={onSelect}
value={label}