Skip to content

refactor(components): [table] use UseTooltipProps for overflow tooltip#24278

Merged
btea merged 5 commits into
element-plus:devfrom
xingyixiang:overflowTooltip_type
May 21, 2026
Merged

refactor(components): [table] use UseTooltipProps for overflow tooltip#24278
btea merged 5 commits into
element-plus:devfrom
xingyixiang:overflowTooltip_type

Conversation

@xingyixiang
Copy link
Copy Markdown
Contributor

@xingyixiang xingyixiang commented May 19, 2026

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.

More flexible - Adding new tooltip props to table overflow tooltip no longer requires updating the Pick list; just pass them through and they work

Consistency - Aligns with how createTablePopper actually handles props (hardcoded values vs. pass-through)

Fewer maintenance - No need to manually sync the allowed prop list when UseTooltipProps evolves

Broader coverage - Props like role, teleported, popperClass, triggerKeys, disabled, popperStyle are now valid for table overflow tooltips, whereas before they were silently blocked

before
after

Summary by CodeRabbit

  • Refactor
    • Refined configuration and typing for table overflow tooltips to simplify available options and exclude content/control-related settings.
    • Adjusted how tooltip properties are composed so overflow tooltips behave more predictably (including positioning/strategy), improving consistency in display.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 19, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: c06a8544-39d3-4a2b-bf96-f750c9529374

📥 Commits

Reviewing files that changed from the base of the PR and between 262449b and f79ca3e.

📒 Files selected for processing (1)
  • packages/components/table/src/util.ts

📝 Walkthrough

Walkthrough

Tooltip imports and the exported TableOverflowTooltipOptions type are updated to use UseTooltipProps, and the table overflow tooltip prop-building logic now removes the pre-merged popperOptions step and applies strategy: 'fixed' plus ...props directly when creating the tooltip VNode.

Changes

Table Overflow Tooltip Typing & Prop Composition

Layer / File(s) Summary
Tooltip import and exported options type
packages/components/table/src/util.ts
Switches tooltip import to default ElTooltip; replaces ElTooltipProps with UseTooltipProps for typing and redefines TableOverflowTooltipOptions as Partial<Omit<UseTooltipProps, ...>>, excluding content, visibility, persistence, auto-close, reference/trigger, and virtual-related props.
Tooltip prop composition at VNode creation
packages/components/table/src/util.ts
Removes the prior popperOptions pre-merge (which forced strategy: 'fixed' and spread props.popperOptions) and instead sets strategy: 'fixed' at the top level and spreads ...props directly when constructing the tooltip VNode for both formatter-produced and default text paths.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • element-plus/element-plus#23610: Introduces table config provider plumbing for tooltip behavior/style via TableConfigContext, which depends on the TableOverflowTooltipOptions type being updated here.

Suggested reviewers

  • btea
  • keeplearning66
  • rzzf

Poem

🐰 I hopped through types and props today,
Swapped picks for omits along the way,
Strategy fixed, no merged popper mess,
Table tooltips now compose much less — yes! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: refactoring table overflow tooltip to use UseTooltipProps instead of ElTooltipProps.
Description check ✅ Passed The PR description provides detailed context about the refactoring benefits (flexibility, consistency, maintenance, broader coverage) and includes before/after code examples, though the contributing checklist remains unchecked.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 19, 2026

Open in StackBlitz

pnpm add https://pkg.pr.new/element-plus@24278
npm i https://pkg.pr.new/element-plus@24278
yarn add https://pkg.pr.new/[email protected]

commit: 175f3a7

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6806d68e8d

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread packages/components/table/src/util.ts
@xingyixiang
Copy link
Copy Markdown
Contributor Author

@rzzf Two checks failed. I initially thought it was due to the non-standard code commit I submitted, so I resubmitted and created a new PR. However, it was eventually found that this was not the cause 😥

@rzzf
Copy link
Copy Markdown
Member

rzzf commented May 20, 2026

@rzzf Two checks failed. I initially thought it was due to the non-standard code commit I submitted, so I resubmitted and created a new PR. However, it was eventually found that this was not the cause 😥

Don't worry, this isn't your issue. The workflow depends on an action that has been blocked by GitHub, so the CI will always fail.

@btea btea merged commit 4de4be9 into element-plus:dev May 21, 2026
14 checks passed
@xingyixiang xingyixiang deleted the overflowTooltip_type branch May 21, 2026 05:52
@element-bot element-bot mentioned this pull request May 29, 2026
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants