Skip to content

Commit 6f3af8b

Browse files
RSS1102tdesign-bot
andauthored
fix(textarea): allow input beyond maxcharacter when allowInputOverMax=true (#5888)
* fix(textarea): allow input beyond max length when `allowInputOverMax` is `true` * chore: stash changelog [ci skip] * chore: stash changelog [ci skip] --------- Co-authored-by: tdesign-bot <[email protected]>
1 parent 640f9c1 commit 6f3af8b

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

packages/components/textarea/textarea.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,9 @@ export default defineComponent({
9191
let val = (target as HTMLInputElement).value;
9292
if (props.maxcharacter && props.maxcharacter >= 0) {
9393
const stringInfo = getCharacterLength(val, props.maxcharacter);
94-
val = typeof stringInfo === 'object' && stringInfo.characters;
94+
if (!props.allowInputOverMax) {
95+
val = typeof stringInfo === 'object' && stringInfo.characters;
96+
}
9597
}
9698
!isComposing.value && setInnerValue(val, { e });
9799
nextTick(() => setInputValue(val));
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
pr_number: 5888
3+
contributor: RSS1102
4+
---
5+
6+
- fix(Textarea): 修复 `allowInputOverMax` 无法在 `maxcharacter` 配置下生效的问题 @RSS1102 ([#5888](https://github.com/Tencent/tdesign-vue-next/pull/5888))

0 commit comments

Comments
 (0)