Skip to content

Conversation

@RylanBot
Copy link
Collaborator

@RylanBot RylanBot commented Nov 3, 2025

🤔 这个 PR 的性质是?

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

🔗 相关 Issue

💡 需求背景和解决方案

📝 更新日志

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

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

  • fix(Popup): 修复自定义的全局 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

tdesign-react-demo

npm i https://pkg.pr.new/tdesign-react@3940

commit: 1a1653e

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
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.

2 participants