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): [table] cell tooltip display error #16868

Merged
merged 3 commits into from
May 20, 2024

Conversation

btea
Copy link
Collaborator

@btea btea commented May 15, 2024

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.

fix #16673
fix #16856

Copy link

github-actions bot commented May 15, 2024

@github-actions github-actions bot added the CommitMessage::Qualified Qualified commit message label May 15, 2024
Copy link

github-actions bot commented May 15, 2024

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

@btea btea changed the title fix(components): [table] cell tooltip diaplay error fix(components): [table] cell tooltip display error May 15, 2024
@btea btea requested a review from plainheart May 20, 2024 00:15
@btea btea requested a review from kooriookami May 20, 2024 01:21
@kooriookami kooriookami merged commit ad0cd51 into dev May 20, 2024
9 checks passed
@kooriookami kooriookami deleted the fix/table-cell-tooltip-diaplay-error branch May 20, 2024 01:26
@element-bot element-bot mentioned this pull request May 31, 2024
3 tasks
@rikako1021
Copy link

Sorry but is this fix really working correctly?
I also had these problems (like #16673 #16856) and since the latest version 2.7.4 was released, I upgraded and built again
but I still have same problem.
I still get tooltip on hover in all columns with show-overflow-tooltip in el-table.

Vue 3.4.13
OS: Windows
Browser: Chrome
Build Tool: Vite

following two have already been done.
rm -rf node_modules
rm package-lock.json

@btea
Copy link
Collaborator Author

btea commented Jun 5, 2024

This problem is essentially caused by precision loss. This PR tolerates a certain degree of precision loss and does solve the related issue.
table

Can you provide an example of your code and provide more information, such as screen size, whether you are scaling the browser page or setting the scale style?

@rikako1021
Copy link

rikako1021 commented Jun 5, 2024

This is my code, I have the same problem on all columns of table.

<el-table :data="datafoo">
      <el-table-column prop="userId" label="column1" show-overflow-tooltip width="200px"/>
      <el-table-column prop="userName" label="column2" show-overflow-tooltip width="250px"/>
      <el-table-column prop="userEmail" label="column3" show-overflow-tooltip min-width="300px"/>
</el-table>

🖋 Note that Element's SCSS specifies the font-size of the table row in this way, and removing this specification eliminated the unnecessary ToolTip display.
Does this mean that not only the X-direction but also the Y-direction overflow is involved in determining whether a ToolTip is displayed or not?
If I don't want to change the font-size, what should I use to adjust it..?

.el-table__row {
  font-size: 16px;
}

@btea
Copy link
Collaborator Author

btea commented Jun 5, 2024

🖋 Note that Element's SCSS specifies the font-size of the table row in this way, and removing this specification eliminated the unnecessary ToolTip display. Does this mean that not only the X-direction but also the Y-direction overflow is involved in determining whether a ToolTip is displayed or not?

Yes

It looks like you changed the cell's font-size so that the content height exceeds the cell height?

@rikako1021
Copy link

rikako1021 commented Jun 5, 2024

Yes.
Strictly, if the font-size exceeds the height of the class name '.cell.el-tooltip', will the tooltip appear? So to prevent the tooltip from appearing without changing font-size, should I adjust the height of this class?

@btea
Copy link
Collaborator Author

btea commented Jun 5, 2024

Yes.

@rikako1021
Copy link

rikako1021 commented Jun 6, 2024

I could fix problem by adjusting cell height! Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CommitMessage::Qualified Qualified commit message
Projects
None yet
4 participants