Skip to content

Commit

Permalink
fix(input-number): fix readonly not working in button mode (#3314)
Browse files Browse the repository at this point in the history
  • Loading branch information
oljc authored Sep 26, 2024
1 parent e967405 commit 3bbdab3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/web-vue/components/input-number/input-number.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,9 @@ export default defineComponent({
needRepeat = false
) => {
event.preventDefault();

if (props.readOnly) return;

inputRef.value?.focus();

nextStep(method, event);
Expand Down
7 changes: 7 additions & 0 deletions packages/web-vue/components/input-number/style/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -150,4 +150,11 @@
}
}
}

&-readonly {
.@{input-number-prefix-cls}-step-button {
color: @input-number-step-button-color_disabled;
pointer-events: none;
}
}
}

0 comments on commit 3bbdab3

Please sign in to comment.