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

"点击空白处,隐藏"有bug,如果点击页面中的iframe就会没触发 #21

Open
qidizi opened this issue Oct 29, 2014 · 2 comments

Comments

@qidizi
Copy link

qidizi commented Oct 29, 2014

如题,
看了眼实现是有问题.
点击iframe中的内容是不会触发document的click的,也就不会hide.
修改成真正意义上的失去焦点才能解决这个问题.
但是这样,移出窗口外它也是会触发的.

@popomore
Copy link
Member

是的,所以尽量避免用 iframe。如果真要实现,你可以在 iframe 监听事件,调用父页面的 hide。

@qidizi
Copy link
Author

qidizi commented Oct 29, 2014

有时是跨域的iframe,所以,不行.
但是为了这个而在iframe中触发top的click也不太好.依赖太深了;
目前使用一个元素总是在show后获得焦点,再配合hover来设置标志(leave=0,enter=1)是否blur时hide;
我目前的应用在overlay面板中,只有一个输入对象.所以,我这么设置是不会有问题的.
不清楚那位有更加通用的方案.让这块更加完善点.

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

No branches or pull requests

2 participants