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(TextArea): when the maximum number of words is reached, content can still be entered at a non-tail cursor #6397

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

zbw-zbw
Copy link

@zbw-zbw zbw-zbw commented Oct 13, 2023

fix #6391

@github-actions
Copy link
Contributor

PR preview has been successfully built and deployed to https://antd-mobile-preview-pr-6397.surge.sh

@afc163 afc163 requested a review from zombieJ October 13, 2023 10:14
return
}
v = configValue.slice(0, maxLength).join('')
maxLengthDataRef.current.isMaxLength =
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个看起来不太对,maxLengthDataRef.current.isMaxLength 不应该是 onChange 里循环依赖的。从实现上看,这边只要在非输入法下裁剪就可以了。不需要记住 isMaxLength。可以参考一下这个:
https://github.com/react-component/input/blob/master/src/Input.tsx#L114

Copy link

codecov bot commented Nov 3, 2023

Codecov Report

Attention: 5 lines in your changes are missing coverage. Please review.

Comparison is base (ed86f9a) 92.36% compared to head (3b6164e) 92.30%.
Report is 35 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6397      +/-   ##
==========================================
- Coverage   92.36%   92.30%   -0.07%     
==========================================
  Files         307      307              
  Lines        6615     6626      +11     
  Branches     1635     1635              
==========================================
+ Hits         6110     6116       +6     
- Misses        470      475       +5     
  Partials       35       35              
Files Coverage Δ
src/components/badge/badge.tsx 100.00% <100.00%> (ø)
src/components/button/button.tsx 93.54% <ø> (-0.21%) ⬇️
src/components/text-area/text-area.tsx 94.68% <73.68%> (-5.32%) ⬇️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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.

Textarea设置最大长度,文本框仍可在非尾部光标处输入内容
2 participants