fix(components): add pointer capture handling to button props

This commit is contained in:
Seibei Iguchi
2026-02-17 16:17:30 +01:00
parent 8e71942f7a
commit 987e9c4aab

View File

@@ -17,10 +17,14 @@ export const pickButtonProps = ({
priority = 'primary',
}: CommonButtonProps) => {
const isLink = href !== undefined;
const handlePointerDown = (event: React.PointerEvent<HTMLElement>) => {
event.currentTarget.setPointerCapture(event.pointerId);
};
return {
as: isLink ? 'a' : 'button',
disabled: isLink ? false : isDisabled || isLoading,
onPointerDown: handlePointerDown,
onClick,
type: isLink ? undefined : type,
tabIndex,