mirror of
https://github.com/trezor/trezor-suite.git
synced 2026-02-20 00:33:07 +01:00
fix(components): add pointer capture handling to button props
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user