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(dialog): beforeOpen double trigger #4838

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

Wesley-0808
Copy link
Contributor

🤔 这个 PR 的性质是?

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

🔗 相关 Issue

💡 需求背景和解决方案

📝 更新日志

  • fix(dialog): 修复Dialog在开启destroyOnCloseonBeforeOpen会触发两次的问题

  • 本条 PR 不需要纳入 Changelog

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

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

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

@Wesley-0808
Copy link
Contributor Author

Wesley-0808 commented Dec 13, 2024

防抖可以解决这个问题,不知道符不符合要求?

Copy link
Contributor

github-actions bot commented Dec 13, 2024

失败

@uyarn
Copy link
Collaborator

uyarn commented Dec 14, 2024

为什么加防抖可以避免触发两次?

@Wesley-0808
Copy link
Contributor Author

Wesley-0808 commented Dec 14, 2024

为什么加防抖可以避免触发两次?

我研究出来了,是 destroyOnClose 与 Transition组件产生了冲突
防抖也不能解决根本问题 因为destroyOnClose会更新渲染 Transition也就会调用BeforeOpen的钩子
甚至只开关 destroyOnClose 都会触发(BeforeOpen、BeforeClose、Opened、Closed)钩子

@Wesley-0808
Copy link
Contributor Author

等build 你看看usage

@Wesley-0808
Copy link
Contributor Author

Wesley-0808 commented Dec 14, 2024

@uyarn

6eb8ce9ec342c8d33358cd28411e8ee0_raw.mp4

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