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

还发现在modal对话框的时候, 关闭事件是可以多次触发的, 行为上应该是仅仅允许关闭一次的~ #1975

Closed
deepkolos opened this issue Oct 22, 2017 · 6 comments
Assignees
Labels

Comments

@deepkolos
Copy link

Version

2.0.0

Environment

win10 1703 chrome 62 stable

Reproduction link

https://mobile.ant.design/kitchen-sink/components/modal?lang=zh-CN

Steps to reproduce

看gif~

What is expected?

同一个modal, 在活动的生命周期里, 只能执行一次关闭事件, 确认事件也一样~

What is actually happening?

可以多次触发

今天我在WEUI也发现有这个bug~
Tencent/weui#678

虽然很少用户会多次点击, 一个关闭~ 除非是十分焦急的时候~ 还是有可能的~

先看图~

bug10

我其他测试了, 除了model有一些例子, 因为出现toast, 挡住了所以行为正确了, 其他都有问题, 虽然是小问题, 影响不大, 但是感觉大厂嘛~ 组件行为还是需要和原生靠近一些滴~~看两个大厂谁修得快~

@ant-design-bot
Copy link

It will be better to write your issue/comment in English, so more people can understand you.
And this means that more people can help you or benefit from your issue/comment.
See: ant-design/ant-design#4897

@warmhug
Copy link
Contributor

warmhug commented Oct 23, 2017

在 真机 上也有这个问题吗?

@silentcloud
Copy link
Contributor

silentcloud commented Oct 23, 2017

这玩意只在 android 下出现,加个锁

@guiyujie
Copy link

guiyujie commented Dec 11, 2017

ant-mobile Model.prompt按钮只能点一次?
image

如果要继续操作怎么办?


自己重新调用以下prompt方法了, 这样锁的设计不合理啊, 既然支持promise ,resolve,reject时解锁不就好了

@warmhug
Copy link
Contributor

warmhug commented Dec 12, 2017

@silentcloud 这个锁,确实加的不对了。。直接导致了功能问题。 @zhang740 跟进下

@warmhug warmhug reopened this Dec 12, 2017
@deepkolos
Copy link
Author

deepkolos commented Dec 13, 2017

触发关闭之后, 关闭动画未结束之前, popup会拦截输入事件, popup属于不可交互状态

所以可以选择在开始关闭动画的时候上锁, 来实现

事件拦截可以通过在popup的根节点在事件捕获的时候用stopPropagation实现, 拦截touch系列事件

@paranoidjk paranoidjk reopened this Dec 14, 2017
@paranoidjk paranoidjk added the bug label Dec 14, 2017
@deepkolos deepkolos reopened this Dec 14, 2017
@paranoidjk paranoidjk assigned zhang740 and unassigned silentcloud Jan 22, 2018
lixiaoyang1992 pushed a commit to lixiaoyang1992/ant-design-mobile that referenced this issue Apr 26, 2018
lixiaoyang1992 pushed a commit to lixiaoyang1992/ant-design-mobile that referenced this issue Apr 26, 2018
lixiaoyang1992 pushed a commit to lixiaoyang1992/ant-design-mobile that referenced this issue Apr 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants