From 54b10f99430cbff7f43f0919a0d45308f6c9d184 Mon Sep 17 00:00:00 2001 From: Pecacheu <3608878+Pecacheu@users.noreply.github.com> Date: Fri, 3 Apr 2026 23:41:57 -0400 Subject: [PATCH 1/3] fix: Add button debounce to solve click-through issue on Chrome mobile Signed-off-by: Pecacheu <3608878+Pecacheu@users.noreply.github.com> --- .../client/components/ui/components/design/Button.tsx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/client/components/ui/components/design/Button.tsx b/packages/client/components/ui/components/design/Button.tsx index c142304a0..bc0ca3457 100644 --- a/packages/client/components/ui/components/design/Button.tsx +++ b/packages/client/components/ui/components/design/Button.tsx @@ -1,9 +1,10 @@ -import { Show, createRenderEffect, on, splitProps } from "solid-js"; +import { Show, createRenderEffect, mergeProps, on, splitProps } from "solid-js"; import { JSX } from "solid-js/jsx-runtime"; import { AriaButtonProps, createButton } from "@solid-aria/button"; import { cva } from "styled-system/css/cva"; +import { debounce } from "@revolt/common"; import { Ripple } from "./Ripple"; import { typography } from "./Text"; @@ -89,7 +90,7 @@ export function Button(props: Props) { "role", ]); - const [style, rest] = splitProps(propsRest, [ + const [style, noSty] = splitProps(propsRest, [ "bg", "size", "shape", @@ -118,6 +119,12 @@ export function Button(props: Props) { ), ); + const [btn, noBtnRest] = splitProps(noSty, ["onPress"]); + + // eslint-disable-next-line @typescript-eslint/no-explicit-any, solid/reactivity + const onPress = debounce((e: any) => btn.onPress?.(e), 100), + rest = mergeProps(noBtnRest, { onPress }); + const { buttonProps } = createButton(rest, () => ref); return (