fix number input step up/down when undefined (#12222)

This commit is contained in:
Azri Kahar
2022-03-18 20:50:13 +08:00
committed by GitHub
parent 54e21c8457
commit c790f0355a
2 changed files with 4 additions and 4 deletions

View File

@@ -142,11 +142,11 @@ const classes = computed(() => [
]);
const isStepUpAllowed = computed(() => {
return props.disabled === false && (props.max === null || parseInt(String(props.modelValue), 10) < props.max);
return props.disabled === false && (props.max === undefined || parseInt(String(props.modelValue), 10) < props.max);
});
const isStepDownAllowed = computed(() => {
return props.disabled === false && (props.min === null || parseInt(String(props.modelValue), 10) > props.min);
return props.disabled === false && (props.min === undefined || parseInt(String(props.modelValue), 10) > props.min);
});
function processValue(event: KeyboardEvent) {

View File

@@ -100,11 +100,11 @@ export default defineComponent({
},
min: {
type: Number,
default: null,
default: undefined,
},
max: {
type: Number,
default: null,
default: undefined,
},
step: {
type: Number,