From 098b24b224661884983a5035ef3b245a519dff14 Mon Sep 17 00:00:00 2001 From: Kainoa Kanter <44733677+ThatOneCalculator@users.noreply.github.com> Date: Thu, 15 Jun 2023 22:12:44 -0700 Subject: [PATCH] Handle number input with type="text" but retain other number validators. --- src/components/single-otp-input.vue | 2 +- src/components/vue3-otp-input.vue | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/single-otp-input.vue b/src/components/single-otp-input.vue index d76df88..7865e5f 100644 --- a/src/components/single-otp-input.vue +++ b/src/components/single-otp-input.vue @@ -165,7 +165,7 @@ export default defineComponent({ input, model, inputTypeValue: - props.inputType === "letter-numeric" ? "text" : props.inputType, + ["letter-numeric", "number"].includes(props.inputType) ? "text" : props.inputType, }; }, }); diff --git a/src/components/vue3-otp-input.vue b/src/components/vue3-otp-input.vue index 8d1d054..97be469 100644 --- a/src/components/vue3-otp-input.vue +++ b/src/components/vue3-otp-input.vue @@ -24,7 +24,7 @@ export default /* #__PURE__ */ defineComponent({ }, separator: { type: String, - default: "**", + default: "", }, inputClasses: { type: [String, Array] as PropType, @@ -57,7 +57,7 @@ export default /* #__PURE__ */ defineComponent({ >, validator: (value: string) => ["numeric", "text", "tel", "none"].includes(value), - default: "numeric", + default: "text", }, shouldAutoFocus: { type: Boolean,