Skip to content

Commit 18ef23c

Browse files
committed
fix: support 'int' type in max and min validations for input props
1 parent ab4a904 commit 18ef23c

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

.changeset/vast-dogs-sip.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@effect-app/vue-components": patch
3+
---
4+
5+
track min max of integers too in input props

packages/vue-components/src/components/OmegaForm/OmegaInternalInput.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,10 +162,10 @@ const inputProps: ComputedRef<InputProps<From, Name>> = computed(() => ({
162162
required: isRequired.value,
163163
minLength: props.meta?.type === "string" && props.meta?.minLength,
164164
maxLength: props.meta?.type === "string" && props.meta?.maxLength,
165-
max: props.meta?.type === "number"
165+
max: (props.meta?.type === "number" || props.meta?.type === "int")
166166
&& (props.meta?.maximum
167167
?? (typeof props.meta?.exclusiveMaximum === "number" && props.meta.exclusiveMaximum - 1)),
168-
min: props.meta?.type === "number"
168+
min: (props.meta?.type === "number" || props.meta?.type === "int")
169169
&& (props.meta?.minimum
170170
?? (typeof props.meta?.exclusiveMinimum === "number" && props.meta.exclusiveMinimum + 1)),
171171
errorMessages: errors.value,

0 commit comments

Comments
 (0)