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(pro:textarea): optimize performance #1968

Merged
merged 1 commit into from
Jul 22, 2024

Conversation

sallerli1
Copy link
Contributor

PR Checklist

Please check if your PR fulfills the following requirements:

  • The commit message follows our guidelines
  • Tests for the changes have been added/updated or not needed
  • Docs and demo have been added/updated or not needed

What is the current behavior?

  1. 输入行过多时,错误行的标红元素dom太多,影响性能
  2. 输入行过多时,行号的dom元素太多,影响性能
  3. 输入行过多时,每次输入变化都会触发所有行的分割和计算,导致卡顿

What is the new behavior?

  1. 根据行高和滚动事件的触发,采用虚拟列表的方式优化渲染,只渲染滚动范围内的错误行和行号元素
  2. 缓存每行的计算结果,在某一行的输入没有变化时,使用上次的计算结果,不重复计算

Other information

Copy link

idux-bot bot commented Jul 22, 2024

This preview will be available after the AzureCI is passed.

Copy link

codecov bot commented Jul 22, 2024

Codecov Report

Attention: Patch coverage is 10.25641% with 35 lines in your changes missing coverage. Please review.

Project coverage is 90.95%. Comparing base (cd304f1) to head (0e41a8d).

Files Patch % Lines
packages/pro/textarea/src/IndexColumn.tsx 0.00% 28 Missing ⚠️
packages/pro/textarea/src/ProTextarea.tsx 12.50% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1968      +/-   ##
==========================================
- Coverage   91.02%   90.95%   -0.07%     
==========================================
  Files         358      358              
  Lines       35662    35691      +29     
  Branches     3889     3889              
==========================================
+ Hits        32460    32463       +3     
- Misses       3202     3228      +26     

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

@sallerli1 sallerli1 force-pushed the fix-pro-textarea-performance branch from e0702c6 to 0e41a8d Compare July 22, 2024 11:50
@sallerli1 sallerli1 merged commit 0fade99 into IDuxFE:main Jul 22, 2024
7 of 9 checks passed
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.

1 participant