fix(Textarea): add hide scrollbar when autosize is true #6019
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.

🤔 这个 PR 的性质是?
🔗 相关 Issue
#5567
Tencent/tdesign-common#2231
💡 需求背景和解决方案
autosize=true,textarea 内部实现的隐藏滚动轴有缺陷;复现条件:
表现:

线上版本的 Textarea ,滚动轴宽度被调整为 6px,视觉上看起来没问题:
如果遇到业务调整滚动条宽度,初始显示、输入都会异常

原因:
calcTextareaHeight 方法新建的计算用 textarea 被设置没有竖向滚动条,它的右侧空间比较多,可以容纳更多文本;
假设它的面积:100px * 100px
而实际渲染的 textarea 有竖向滚动条,滚动条占了一定的右侧空间;
假设滚动条width=10px,同样的文本,实际渲染的 textarea 需要 111.1px * 90px = 100px * 100px;
若实际渲染的 textarea 需不显示滚动条,需要 height=111px,计算得到的 100px 不够用
📝 更新日志
tdesign-vue-next
autosize没有完整自动撑开高度,存在有滚动条的问题@tdesign-vue-next/chat
@tdesign-vue-next/auto-import-resolver
☑️ 请求合并前的自查清单