From c86b8e4ecdec538d4c4d3f8eccb5b778aca1b6e4 Mon Sep 17 00:00:00 2001 From: Mou Date: Sat, 12 Oct 2024 14:43:05 +0200 Subject: [PATCH] Handle touchend event on password visibility toggle --- .../core/src/components/PasswordInput/PasswordInput.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/@mantine/core/src/components/PasswordInput/PasswordInput.tsx b/packages/@mantine/core/src/components/PasswordInput/PasswordInput.tsx index 8278ffaa411..4a8ecef9d66 100644 --- a/packages/@mantine/core/src/components/PasswordInput/PasswordInput.tsx +++ b/packages/@mantine/core/src/components/PasswordInput/PasswordInput.tsx @@ -155,6 +155,11 @@ export const PasswordInput = factory((_props, ref) => { variant="subtle" color="gray" unstyled={unstyled} + onTouchEnd={(event) => { + event.preventDefault(); + visibilityToggleButtonProps?.onTouchEnd?.(event); + toggleVisibility(); + }} onMouseDown={(event) => { event.preventDefault(); visibilityToggleButtonProps?.onMouseDown?.(event);