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(components): [el-table] rangeWidth dealing with loss of precision #12938

Merged
merged 6 commits into from
Jul 30, 2023

Conversation

lxy030988
Copy link
Contributor

Closes #12687

Please make sure these boxes are checked before submitting your PR, thank you!

  • Make sure you follow contributing guide English | (中文 | Español | Français).
  • Make sure you are merging your commits to dev branch.
  • Add some descriptions and refer to relative issues for your PR.

Description

调整表格的列宽到显示tooltip的临界值(出现省略号),会出现tooltip效果不生效。
造成词现象的原因,rangeWidth 计算使用的四舍五入,丢失零点几像素的宽度。
修改方案:计算 rangeWidth 宽度 使用向上取整。

Related Issue

Fixes #12687

Explanation of Changes

@pull-request-triage
Copy link

👋 @lxy030988, seems like this is your first time contribution to element-plus.

  • Please make sure that you have read our guidelines and code of conduct before making a contribution.
  • You can comment with /label Components:[component_name] to add a label for which component you are working on.
  • You may join our Discord for staying tuned.

@pull-request-triage pull-request-triage bot added 1st contribution Their very first contribution Needs Review labels May 25, 2023
@github-actions
Copy link

github-actions bot commented May 25, 2023

@github-actions
Copy link

Hello @lxy030988, thank you for contributing to element-plus, please see our guideline to see how to make contribution

@github-actions
Copy link

github-actions bot commented May 25, 2023

🧪 Playground Preview: https://element-plus.run/?pr=12938
Please comment the example via this playground if needed.

@btea
Copy link
Collaborator

btea commented Jul 5, 2023

@lxy030988 Could you please update the code with this suggestion?

@lxy030988 lxy030988 closed this Jul 7, 2023
@lxy030988 lxy030988 reopened this Jul 7, 2023
@btea btea requested review from chenxch and tolking July 29, 2023 07:04
@btea btea changed the title fix(components): [el-table] rangeWidth use Math.ceil fix(components): [el-table] rangeWidth dealing with loss of precision Jul 30, 2023
@btea
Copy link
Collaborator

btea commented Jul 30, 2023

@lxy030988 Thank you for your contribution! ❤️

@btea btea merged commit 1bd75dd into element-plus:dev Jul 30, 2023
10 checks passed
@element-bot element-bot mentioned this pull request Aug 4, 2023
3 tasks
consultation-applio pushed a commit to consultation-applio/element-plus that referenced this pull request Nov 10, 2023
…element-plus#12938)

* fix(components): [el-table] rangeWidth use Math.ceil

Closes element-plus#12687

* fix(components): [el-table] rangeWidth calculate

Closes 12938

* fix(components): [el-table] offsetWidth calculate

Closes element-plus#12938
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants