Skip to content

Commit

Permalink
fix(input): solve prop number declaration issue (#1150)
Browse files Browse the repository at this point in the history
  • Loading branch information
mlmoravek authored Dec 17, 2024
1 parent 226f19b commit 123dc6f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/oruga/src/components/input/Input.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
import OIcon from "../icon/Icon.vue";
import { getDefault } from "@/utils/config";
import { isTrueish } from "@/utils/helpers";
import { defineClasses, useDebounce, useInputHandler } from "@/composables";
import { injectField } from "../field/fieldInjection";
Expand Down Expand Up @@ -129,7 +130,7 @@ const vmodel = defineModel<ModelValue, string, string, ModelValue>({
set: (value) =>
typeof value == "undefined"
? value
: props.number
: isTrueish(props.number)
? Number(value)
: String(value),
default: undefined,
Expand Down Expand Up @@ -231,7 +232,7 @@ function iconClick(event: Event): void {
function rightIconClick(event: Event): void {
if (props.passwordReveal) togglePasswordVisibility();
else if (props.clearable)
vmodel.value = (props.number ? 0 : "") as ModelValue;
vmodel.value = (isTrueish(props.number) ? 0 : "") as ModelValue;
if (props.iconRightClickable) {
emits("icon-right-click", event);
nextTick(() => setFocus());
Expand Down

0 comments on commit 123dc6f

Please sign in to comment.