From a88710f3cb0a055d05ac4e58e9d6b0e9ca0cfda4 Mon Sep 17 00:00:00 2001 From: tkwant Date: Mon, 27 Feb 2023 22:54:44 +0100 Subject: [PATCH] fix: onClick event was triggered on pointerleave when allowHover is disabled --- src/components/Rating.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Rating.tsx b/src/components/Rating.tsx index af790d6..24f346c 100644 --- a/src/components/Rating.tsx +++ b/src/components/Rating.tsx @@ -221,7 +221,7 @@ export function Rating({ } const handlePointerLeave = (event: PointerEvent) => { - if (isTouchDevice()) handleClick() + if (isTouchDevice() && allowHover) handleClick() dispatch({ type: 'PointerLeave' }) if (onPointerLeave) onPointerLeave(event)