Skip to content

Conversation

@RylanBot
Copy link
Collaborator

@RylanBot RylanBot commented Nov 3, 2025

🤔 这个 PR 的性质是?

  • 日常 bug 修复
  • 新特性提交
  • 文档改进
  • 演示代码改进
  • 组件样式/交互改进
  • CI/CD 改进
  • 重构
  • 代码风格优化
  • 测试用例
  • 分支合并
  • 其他

🔗 相关 Issue

💡 需求背景和解决方案

Note

该 PR 解决了 children 为普通二次封装组件,无法正常穿透的问题。但是如果它使用了 useImperativeHandle 覆盖 ref,从而误判导致拿不到 DOM 节点,仍需要用户自己手动使用 <></> 包裹,例如 #3990

Ant Design 底层也有类似的问题:https://ant.design/components/popover-cn#faq

📝 更新日志

  • fix(Popup): 修复 triggerElement 类型为字符串时未正确作为元素选择器解析的问题

  • fix(Popup): 修复 children 为不支持 ref 穿透的封装组件时,弹窗无法正常出现的问题

  • fix(PopupPlugin): 修复 classPrefix 不生效的问题

  • 本条 PR 不需要纳入 Changelog

☑️ 请求合并前的自查清单

⚠️ 请自检并全部勾选全部选项⚠️

  • 文档已补充或无须补充
  • 代码演示已提供或无须提供
  • TypeScript 定义已补充或无须补充
  • Changelog 已提供或无须提供

@github-actions
Copy link
Contributor

github-actions bot commented Nov 3, 2025

完成

@RylanBot RylanBot changed the title Rylan/refactor/popup fix(Popup): triggerElement string not working as CSS selector Nov 3, 2025
@RylanBot RylanBot requested a review from Copilot November 3, 2025 10:10
@pkg-pr-new
Copy link

pkg-pr-new bot commented Nov 3, 2025

commit: c3e047f

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors the popup trigger mechanism by replacing inline event handler props with direct DOM event listeners, fixes a typo in the TooltipLite component's displayName, and updates snapshot tests accordingly.

  • Migrated trigger event handling from React props to native DOM event listeners in useTrigger.tsx
  • Fixed displayName from 'Tooltiplite' to 'TooltipLite' for consistency
  • Enhanced event listener utilities to support options like passive

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
test/snap/snapshots/csr.test.jsx.snap Updated snapshot to reflect reordered CSS classes in button element
packages/components/tooltip/TooltipLite.tsx Fixed displayName capitalization from 'Tooltiplite' to 'TooltipLite'
packages/components/popup/hooks/useTrigger.tsx Refactored trigger event handling from React synthetic events to native DOM listeners
packages/components/popup/PopupPlugin.tsx Added dynamic componentName using classPrefix from config
packages/components/popup/Popup.tsx Updated to use refactored useTrigger hook API
packages/components/_util/ref.ts Added mergeRefs utility function for combining multiple refs
packages/components/_util/listener.ts Added options parameter support for addEventListener/removeEventListener

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@RylanBot RylanBot force-pushed the rylan/refactor/popup branch from 557a202 to 8fc31af Compare November 3, 2025 10:33
@RylanBot RylanBot force-pushed the rylan/refactor/popup branch from c19761d to 029f191 Compare November 3, 2025 10:47
@RylanBot RylanBot added the WIP work in porgess label Nov 3, 2025
@RylanBot RylanBot removed the WIP work in porgess label Nov 3, 2025
@RylanBot RylanBot force-pushed the rylan/refactor/popup branch 2 times, most recently from c96c8cc to a68802e Compare December 7, 2025 20:54
@uyarn
Copy link
Collaborator

uyarn commented Dec 10, 2025

/update-common

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 22 out of 22 changed files in this pull request and generated 9 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@uyarn uyarn merged commit 3e2b190 into develop Dec 15, 2025
9 checks passed
@uyarn uyarn deleted the rylan/refactor/popup branch December 15, 2025 08:07
@github-actions github-actions bot mentioned this pull request Dec 15, 2025
16 tasks
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.

4 participants