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

The maximum content length of the textarea component is calculated incorrectly #4098

Open
1 task done
RicardoWL opened this issue May 19, 2021 · 4 comments
Open
1 task done
Assignees

Comments

@RicardoWL
Copy link

RicardoWL commented May 19, 2021

  • I have searched the issues of this repository and believe that this is not a duplicate.

Version

2.1.4

Environment

官方文档示例

Reproduction link

https://2x.antdv.com/components/input-cn#components-input-demo-show-count

Steps to reproduce

官方文档示例中的带字数提示的文本域,此文本域长度限制为100,输入以下文本内容:

1.连接体设计的目的 通过各类连接体将义齿的多个部件连城一个整体,有利于义齿的固位多稳定,并将𬌗力传递、分布于基牙和相邻的支持组织,使义齿所受的力能较合理的分布。此外,通过连接体设计还可以增加义齿的

上述内容通过js的字符串长度属性取得长度为100

What is expected?

显示的统计长度也为100

What is actually happening?

显示的统计长度为99


官方组件示例即可复现

@github-actions github-actions bot changed the title textarea组件最大内容长度计算有误 The maximum content length of the textarea component is calculated incorrectly May 19, 2021
@John60676
Copy link
Member

貌似是 "𬌗".length

@RicardoWL
Copy link
Author

貌似是 "𬌗".length

那这个统计能统一一下或者特殊处理嘛?虽然这种情况并不常见,但是出现的话,统计字数展示就对不上了。

@John60676
Copy link
Member

John60676 commented May 19, 2021

99才是真实的字数

image

@RicardoWL
Copy link
Author

99才是真实的字数

我知道99是真实的字数,但是我使用了maxLength=100后,这里就不能继续输入了,无法达到我设置的最大长度,字数展示上也无法到达100

@John60676 John60676 self-assigned this May 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants