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

处理与其他包的快捷键冲突 #135

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

iwestlin
Copy link

我在将zmage和antd的modal搭配使用的时候遇到了esc快捷键冲突的问题,尽管zmage位于modal之上,但按下escape后先退出的却是modal,考虑到zmage应该一直处于网页的最顶层(至少在我的情况下),所以在它全屏的时候有权拦截所有快捷键。

这个解决方法是把keydown事件绑定在捕获阶段并停止事件进一步传播,可能太过粗暴,仅供参考。。

我在将zmage和antd的modal搭配使用的时候遇到了esc快捷键冲突的问题,尽管zmage位于modal之上,但按下escape后先退出的却是modal,考虑到zmage应该一直处于网页的最顶层(至少在我的情况下),所以在它全屏的时候有权拦截所有快捷键。

这个解决方法是把keydown事件绑定在捕获阶段并停止事件进一步传播,可能太过粗暴,仅供参考。。
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.

1 participant