Skip to content

Conversation

@RylanBot
Copy link
Collaborator

@RylanBot RylanBot commented Aug 28, 2025

🤔 这个 PR 的性质是?

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

🔗 相关 Issue

💡 需求背景和解决方案

import React, { forwardRef } from 'react'; import { Button, Popup } from 'tdesign-react'; const MyBtn1 = () => <Button>Click me</Button>; const MyBtn2 = forwardRef((props, ref) => ( <Button ref={ref} {...props}> Click me </Button> )); export default function BasicUsage() { return ( <> <Popup content="无法弹出"> <MyBtn1 /> </Popup> <Popup content="可以弹出"> <> <MyBtn1 /> </> </Popup> <Popup content="可以弹出"> <MyBtn2 /> </Popup> </> );

但这次修复后依旧有一个问题,下面这种也被判断为 supportRef,但是 props 实际上没有穿透,还是无法弹出...
只能在文档的 FAQ 标明,让用户手动使用 <></> 包裹

const MyBtn3 = forwardRef((_, ref) => ( <Button ref={ref}> Click me </Button> ));

Tip

该 PR 不再处理,新的 PR 会解决上述所有问题,包括 props 没有穿透的问题

📝 更新日志

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

  • 本条 PR 不需要纳入 Changelog

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

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

  • 文档已补充或无须补充
  • 代码演示已提供或无须提供
  • TypeScript 定义已补充或无须补充
  • Changelog 已提供或无须提供
@pkg-pr-new
Copy link

pkg-pr-new bot commented Aug 28, 2025

tdesign-react-demo

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

commit: 9984685

@github-actions
Copy link
Contributor

github-actions bot commented Aug 28, 2025

完成

@RylanBot RylanBot closed this Nov 3, 2025
@RylanBot RylanBot deleted the rylan/fix/popup/trigger branch November 3, 2025 10:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants