Skip to content

Commit

Permalink
fix(input-number): 修复 disabled 下未禁用点击问题 (#2783)
Browse files Browse the repository at this point in the history
close #2782
  • Loading branch information
eiinu authored Dec 21, 2023
1 parent d9a0cc9 commit c470d0e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/packages/__VUE/inputnumber/index.taro.vue
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ export default create({
return value > Number(props.min) && !props.disabled;
};
const reduce = (event: Event) => {
if (props.disabled) return;
emit('reduce', event);
let output_value = Number(props.modelValue) - Number(props.step);
if (reduceAllow() && output_value >= Number(props.min)) {
Expand All @@ -121,6 +122,7 @@ export default create({
}
};
const add = (event: Event) => {
if (props.disabled) return;
emit('add', event);
let output_value = Number(props.modelValue) + Number(props.step);
if (addAllow() && output_value <= Number(props.max)) {
Expand Down
2 changes: 0 additions & 2 deletions src/packages/__VUE/inputnumber/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ export default create({
};
const change = (event: Event) => {
const input = event.target as HTMLInputElement;
emit('update:modelValue', input.value, event);
};
const emitChange = (value: string | number, event: Event) => {
Expand Down Expand Up @@ -155,7 +154,6 @@ export default create({
}
return value;
};
watch(
() => [props.max, props.min],
() => {
Expand Down

0 comments on commit c470d0e

Please sign in to comment.