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:table): width calculation problem after resize #1417

Merged
merged 1 commit into from Jan 16, 2023

Conversation

danranVm
Copy link
Member

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?

  • 在表格实际渲染宽度超过了 scroll.width 的时候,每一列都会被放大
    • 例如本身设置的宽度是 80 ,实际渲染成了 200,缩放了 2.5 倍
    • 如果此时通过拖拽拉到了 150px, 经过缩放后实际渲染成了 350px
    • 就会出现用户拖拽缩小宽度,但是反而增大了的宽度的异常情况。

What is the new behavior?

/**
 * 拖拽宽度计算规则
 *
 * * 如果不存在原始的 column.width, 则直接将拖拽后的宽度赋值给 column.width
 * * 如果存在原始的 column.width, 则需要按比例进行计算: (原始宽度 * 拖拽后段都) / 当前真实渲染的宽度
 * * * 同时需要判断是否存在 minWidth, maxWidth,应满足 minWidth < 计算后的宽度 < maxWidth
 */

Other information

@idux-bot
Copy link

idux-bot bot commented Jan 16, 2023

This preview will be available after the AzureCI is passed.

@codecov
Copy link

codecov bot commented Jan 16, 2023

Codecov Report

Merging #1417 (6938a84) into main (5d604f9) will decrease coverage by 0.09%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             main    #1417      +/-   ##
==========================================
- Coverage   92.90%   92.80%   -0.10%     
==========================================
  Files         325      327       +2     
  Lines       29930    30288     +358     
  Branches     2495     2541      +46     
==========================================
+ Hits        27805    28110     +305     
- Misses       2125     2178      +53     
Impacted Files Coverage Δ
packages/pro/transfer/src/token.ts 100.00% <0.00%> (ø)
packages/pro/transfer/src/types.ts 100.00% <0.00%> (ø)
packages/components/cascader/src/token.ts 100.00% <0.00%> (ø)
packages/components/cascader/src/types.ts 100.00% <0.00%> (ø)
packages/pro/transfer/src/utils.ts
packages/cdk/utils/src/tree.ts 98.40% <0.00%> (ø)
packages/components/utils/src/useDisabled.ts 100.00% <0.00%> (ø)
.../components/utils/src/useTreeCheckStateResolver.ts 74.82% <0.00%> (ø)
packages/components/cascader/src/Cascader.tsx 96.07% <0.00%> (+0.20%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@danranVm danranVm merged commit d7ef42c into IDuxFE:main Jan 16, 2023
@danranVm danranVm deleted the fix-pro-table-resizable-2 branch January 16, 2023 07:36
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.

None yet

1 participant