jQuery Dialog blocks Firefox hotkeys

谁说胖子不能爱 提交于 2019-12-24 22:17:18

问题


I'm currently working with jQuery 1.4.2 and jQuery UI 1.8.2.

I'm experiencing some weird behavior after I have closed a modal dialog. When I try to reload the page with Ctrl+F5 nothing happens. Another weird thing is that the context menu of Firefox can only be opened with right clicking twice.

The Firebug console is showing me the following message when I press the Ctrl key: The ‘charCode’ property of a keydown-event should not be used. The value is meaningless.

Demo page: http://testing.allinonesoftware.com/jquery/index.php

Luke


回答1:


This is the intended behavior...however there is a browser difference here. Firefox is not focusing inside your dialog on open.

If you click outside the modal and try F5 in any other browser, same effect, no refresh.
Also, if you click inside the modal with Firefox, your F5 will work.

To make this behavior consistent across browsers, focus the element you're making the dialog on open, or if you want, focus one of the buttons...either will have the same effect, as long as the keypress goes inside the dialog.

For the error message:

The ‘charCode’ property of a keydown-event should not be used. The value is meaningless.

This is just how jQuery does some things, you can ignore it...it has no impact on your current issue.



来源:https://stackoverflow.com/questions/2608346/jquery-dialog-blocks-firefox-hotkeys

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!