Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the bug of textarea with maxlength can't input before limit #3044

Merged
merged 2 commits into from
Jan 22, 2024

Conversation

azx1573
Copy link
Contributor

@azx1573 azx1573 commented Jan 17, 2024

🤔 这个 PR 的性质是?

  • 日常 bug 修复
  • 新特性提交
  • 文档改进
  • 演示代码改进
  • 组件样式/交互改进
  • CI/CD 改进
  • 重构
  • 代码风格优化
  • 测试用例
  • 分支合并
  • 其他

🔗 相关 Issue

#3041

💡 需求背景和解决方案

背景:用户提出issue,反馈设置maxlength后,windows自带输入法,当输入中文时所输入字符还没有达到最大长度也会没法输入。

问题描述:textarea公共组件做输入字符限制时,每次 input 事件触发时剪切输入值以符合最大长度。这种剪切假设了所有字符将键入的同时变成结果字符,也就是说,如果用户正在输入一个长拼音字符序列(比如汉字的拼音),但还没有选择对应的汉字结果,输入就会被提前剪切,因为拼音可能会超过最大长度。

解决方案:用户在构词状态时不应该设置输入限制和字符剪切,而是等完成后。

📝 更新日志

  • fix(Textarea): 修复设置maxlength后,在windows自带输入法中,中文时不到最大长度也会自动覆盖之前已输入内容的缺陷

  • 本条 PR 不需要纳入 Changelog

☑️ 请求合并前的自查清单

⚠️ 请自检并全部勾选全部选项⚠️

  • 文档已补充或无须补充
  • 代码演示已提供或无须提供
  • TypeScript 定义已补充或无须补充
  • Changelog 已提供或无须提供

修复用户反馈issue"[Textarea]
textarea在折叠面板内时,高度计算不正确,会出现滚动条",issue详情见:Tencent#2809
…input before limit

用户提出issue,反馈设置maxlength后,windows自带输入法,当输入中文时所输入字符还没有达到最大长度也会没法输入.
@azx1573 azx1573 changed the title Fix/text maxlength Fix the bug of textarea with maxlength can't input before limit Jan 17, 2024
Copy link
Contributor

完成

@uyarn uyarn merged commit f82e178 into Tencent:develop Jan 22, 2024
5 checks passed
@github-actions github-actions bot mentioned this pull request Jan 23, 2024
16 tasks
uyarn added a commit that referenced this pull request Jan 25, 2024
* docs(Card): update api (#3021)

* docs(Card): update api

* chore: update _common

* fix(loading): fix functional repeated call error (#3025)

* docs: update unplugin usage desc with webpack (#3030)

* feat(form): change form methods type-definition to required (#3034)

change form methods type-definition to required

* feat(descriptions): add descriptions (#3035)

* feat(descriptions): add descriptions

* feat(descriptions): example test

* feat(descriptions): utils ts

* feat(descriptions): descriptions body

* test(descriptions): update snap

* fix(descriptions): tDescriptionsBody

* chore(descriptions): remove

* fix(table): 移除非必要的分页监听 (#3046)

* fix(table): pagination

* fix: lint error

* fix: fix the bug of textarea with maxlength can't input before limit (#3044)

* fix(tag-input): pass size api to collapse item (#3055)

* feat(Slider): support change end API (#3056)

* feat(Slider): support change end API

* feat(Slider): support change end API

* fix(Select): fix clear trigger onchange callback twice (#3054)

* fix(Select): fix clear trigger onchange callback twice

* chore: fix lint

* fix(textarea): value绑定值时,autosize时无法输入中文问题 (#3057)

* fix(Form): fix form string length test (#3058)

* chore: release 1.9.0 (#3059)

* chore: release 1.9.0

* chore: changelog's changes

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

---------

Co-authored-by: liweijie0812 <[email protected]>
Co-authored-by: Zz-ZzzZ <[email protected]>
Co-authored-by: iiimix <[email protected]>
Co-authored-by: zhangpaopao <[email protected]>
Co-authored-by: sheepluo <[email protected]>
Co-authored-by: 梓晨 <[email protected]>
Co-authored-by: LoopZhou <[email protected]>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants