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): 公共组件当初始处于隐藏状态再次可视后未做高度再计算的问题 #3003

Merged
merged 2 commits into from
Dec 27, 2023

Conversation

azx1573
Copy link
Contributor

@azx1573 azx1573 commented Dec 26, 2023

🤔 这个 PR 的性质是?

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

🔗 相关 Issue

💡 需求背景和解决方案

需求背景:
使用者提出issue,反馈t-textarea公共组件存在高度计算问题,经定位,该组件已知存在两个问题

  1. 没有在任何组件中嵌套的情况:当使用该组件时,如果v-model初始绑定的值是固定值(而不是异步赋的值,比如通过接口请求或者使用宏任务模拟的赋值),比如v-model绑定的值是value,在data中为value赋了很长的初始值,此时会存在issue中提到的这个问题,但是如果初始值不是固定值是后期通过接口请求或者宏任务模拟赋的值,则不会存在这个问题。
  2. 当该组件在部分组件内嵌套使用时,比如t-collapse-panel中,则初始时该组件并没机会通过计算获得高度,而面板再次被展开该组件再次可视后,组件内并没有针对这种场景做高度的重新计算,因此该组件的响应式高度在此场景下失效。

解决方案:
针对问题1:需要确保高度的计算是在DOM挂载完成后进行
针对问题2:仅通过在mounted中和监听value值的变动时做高度响应式计算是不够的,还需要考虑这种初始时该组件处于“隐藏”再次可视的情况。

📝 更新日志

  • fix(Textarea): 修复组件初始处于隐藏状态,可视后未做高度再计算的问题

  • 本条 PR 不需要纳入 Changelog

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

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

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

修复用户反馈issue"[Textarea]
textarea在折叠面板内时,高度计算不正确,会出现滚动条",issue详情见:Tencent#2809
t-textarea在部分场景比如t-collapse-panel中使用时,初始化加载时该组件没有高度,但是当再次可视时因为没有再次做高度的计算导致没有获得响应式高度因此出现这个问题.
@azx1573 azx1573 changed the title Fix/t textarea 修复t-textarea公共组件当初始处于隐藏状态再次可视后未做高度再计算的问题 Dec 26, 2023
Copy link
Contributor

完成

@uyarn uyarn changed the title 修复t-textarea公共组件当初始处于隐藏状态再次可视后未做高度再计算的问题 fix(textarea): 公共组件当初始处于隐藏状态再次可视后未做高度再计算的问题 Dec 27, 2023
@uyarn uyarn merged commit 2c56cd5 into Tencent:develop Dec 27, 2023
5 checks passed
@github-actions github-actions bot mentioned this pull request Jan 2, 2024
16 tasks
uyarn pushed a commit that referenced this pull request Jan 2, 2024
* fix(textarea.tsx): 修复textarea在折叠面板内时,高度计算不正确,会出现滚动条的问题

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

* fix(textarea.tsx): 修复t-textarea公共组件在初始被隐藏时没有做高度计算的问题

t-textarea在部分场景比如t-collapse-panel中使用时,初始化加载时该组件没有高度,但是当再次可视时因为没有再次做高度的计算导致没有获得响应式高度因此出现这个问题.
uyarn added a commit that referenced this pull request Jan 2, 2024
* fix(table): uploadFilePercent does not work with autoUpload=false (#2991)

* fix(table): uploadFilePercent

* fix: lint eorr

* fix(upload): image preview

* feat(card): card组件支持传入loadingProps参数 (#2959)

* feat(card): card组件支持传入loadingProps参数

card组件支持传入loadingProps参数

fix #423

* chore: merge develop

* feat(card): card组件支持传入loadingProps参数

card组件支持传入loadingProps参数

fix #423

* refactor(card): props属性用法优化

* chore: update snapshot

* chore: update snapshot

---------

Co-authored-by: Uyarn <uyarnchen@gmail.com>

* fix(table): affixed bugs, filter icon highlight bug (#2990)

* fix(table): affixed bugs

* fix(table): fix filter can not highlight with number 0

* chore: fix pagination text (#2996)

* fix(radio): the checked state also triggers the change event (#3000)

* fix(radio): the checked state also triggers the change event

* test(radio): the checked state also triggers the change event

* docs: update FAQ (#3002)

* docs: update FAQ

* chore: update docs

* fix(textarea): 公共组件当初始处于隐藏状态再次可视后未做高度再计算的问题 (#3003)

* fix(textarea.tsx): 修复textarea在折叠面板内时,高度计算不正确,会出现滚动条的问题

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

* fix(textarea.tsx): 修复t-textarea公共组件在初始被隐藏时没有做高度计算的问题

t-textarea在部分场景比如t-collapse-panel中使用时,初始化加载时该组件没有高度,但是当再次可视时因为没有再次做高度的计算导致没有获得响应式高度因此出现这个问题.

* feat: provide a method to calculate the height of textArea component after DOM mounted (#3006)

* fix(textarea.tsx): 修复textarea在折叠面板内时,高度计算不正确,会出现滚动条的问题

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

* fix(textarea.tsx): 修复t-textarea公共组件在初始被隐藏时没有做高度计算的问题

t-textarea在部分场景比如t-collapse-panel中使用时,初始化加载时该组件没有高度,但是当再次可视时因为没有再次做高度的计算导致没有获得响应式高度因此出现这个问题.

* fix(textarea.tsx): provide a method to calculate the height of textArea component after DOM mounted

Provide a method to calculate the height of textArea component after DOM mounted

* chore(deps-dev): bump @typescript-eslint/typescript-estree (#3009)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/typescript-estree"
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* fix(imageviewer): 添加defaultScale (#3013)

添加defaultScale

* docs: update popup plugin demo (#3014)

* fix(upload): form disabled should effect upload trigger button (#3012)

* fix(upload): form disabled should effect upload trigger button

* chore: update snapshot

* chore: release 1.8.4 (#3015)

* chore: release 1.8.4

* chore: changelog's changes

---------

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

* chore: update snapshot

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: sheepluo <yaoyanhuoyi@qq.com>
Co-authored-by: iiimix <690360602@qq.com>
Co-authored-by: betavs <34408516+betavs@users.noreply.github.com>
Co-authored-by: 梓晨 <2777689609@qq.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: sinbadmaster <40019023+sinbadmaster@users.noreply.github.com>
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