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

[Dialog] Dialog和Drawer 需要提供一个 弹窗打开/关闭时触发事件 #4709

Closed
yrc2333 opened this issue Nov 4, 2024 · 8 comments
Closed
Labels
easy easy level of difficulties 💪🏻 enhancement New feature or request issueShoot to be published to be published

Comments

@yrc2333
Copy link

yrc2333 commented Nov 4, 2024

这个功能解决了什么问题

目前Dialog/Drawer只提供了onOpened api在弹出动画效果结束后触发

  1. 当打开弹窗动画执行完后再通过接口获取相关参数会更加耗时
  2. 在编辑表单信息场景下,弹窗动画执行完再执行更改表单初始化操作会存在表单值切换效果

你建议的方案是什么

建议补充类似其他开源库的api
image

IssueShoot

  • 预估时长: 1
  • 期望完成时间: 2024-11-15 00:00:00 +0000 UTC
  • 开发难度: 低
  • 参与人数: 1
  • 需求对接人: ivringpeng
  • 验收标准: 实现期望改造效果,提 PR 并通过验收无误
  • 备注: 最终激励以实际提交 pull request 并合并为准
Copy link
Contributor

github-actions bot commented Nov 4, 2024

👋 @yrc2333,感谢给 TDesign 提出了 issue。
请根据 issue 模版确保背景信息的完善,我们将调查并尽快回复你。

@Wesley-0808
Copy link
Contributor

针对你提出的第一个问题,如果后端服务器的响应速度/返回速度没有这么快的话,那么其实可以在设置visibletrue之前,先发起请求 获取数据
第二个问题,我做了一个项目也是有使用Dialog编辑内容的功能,我的解决方案也同上述思路差不多,就是在设置visibletrue前,先把数据放到formdata
如果是因网络延时造成较差的用户体验 那么其实即使有BeforeOpen/BeforeClose的差别也不会多大,该卡还得卡,因为弹窗动画就0.28s

@Wesley-0808
Copy link
Contributor

当然了,有这两个api的话 在适用性上会更好一点

@yrc2333
Copy link
Author

yrc2333 commented Nov 5, 2024

是的,算是优化需求吧,在使用上也更加符合直觉。而且我看像其他几个主流的组件库也都有提供类似功能

@uyarn
Copy link
Collaborator

uyarn commented Nov 12, 2024

可以支持

@uyarn uyarn added 💪🏻 enhancement New feature or request issueShoot easy easy level of difficulties labels Nov 12, 2024
@Wesley-0808
Copy link
Contributor

@uyarn API那边是需要你们加吗?还是共创者都能提pr?

@liweijie0812
Copy link
Collaborator

@uyarn API那边是需要你们加吗?还是共创者都能提pr?

都可以

@uyarn
Copy link
Collaborator

uyarn commented Nov 20, 2024

supported 1.10.4, thanks for @Wesley-0808

@uyarn uyarn closed this as completed Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
easy easy level of difficulties 💪🏻 enhancement New feature or request issueShoot to be published to be published
Projects
None yet
Development

No branches or pull requests

4 participants