From 0f8fd5d2d82a45cefc47e64b1abcf6eba5e8b1f1 Mon Sep 17 00:00:00 2001 From: SonTT19 <49301480+SonTT19@users.noreply.github.com> Date: Wed, 17 Jul 2024 02:30:05 +0700 Subject: [PATCH] fix(VOtpInput): slice value with length on paste (#20164) fixes #20158 --- packages/vuetify/src/components/VOtpInput/VOtpInput.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/vuetify/src/components/VOtpInput/VOtpInput.tsx b/packages/vuetify/src/components/VOtpInput/VOtpInput.tsx index f1b59a088df..fac9e739a33 100644 --- a/packages/vuetify/src/components/VOtpInput/VOtpInput.tsx +++ b/packages/vuetify/src/components/VOtpInput/VOtpInput.tsx @@ -166,7 +166,7 @@ export const VOtpInput = genericComponent()({ e.preventDefault() e.stopPropagation() - const clipboardText = e?.clipboardData?.getData('Text') ?? '' + const clipboardText = e?.clipboardData?.getData('Text').slice(0, length.value) ?? '' if (isValidNumber(clipboardText)) return