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

keymap快捷键未屏蔽浏览器默认设置,比如Ctrl-S #46

Closed
byhgj opened this issue Mar 12, 2015 · 3 comments
Closed

keymap快捷键未屏蔽浏览器默认设置,比如Ctrl-S #46

byhgj opened this issue Mar 12, 2015 · 3 comments

Comments

@byhgj
Copy link

byhgj commented Mar 12, 2015

click Ctrl-S,能alert,但同时浏览器也弹出保存对话框。

@pandao
Copy link
Owner

pandao commented Mar 13, 2015

能说具体是什么样的场景下出现你说的那种情况?KeyMap是在CodeMirror onfocus时才有效。

@byhgj
Copy link
Author

byhgj commented Mar 18, 2015

输入焦点在编辑框时,测试了firefox和IE,都会弹出浏览器默认保存。
用了kodExplorer,里面的编辑框onfocus保存时就不会弹出浏览器默认Ctrl-S。
这是editor.md测试代码:

var keyMap = {
    'Ctrl-S': function(cm){
        alert('ctrl+s');
    }
};
testEditor.addKeyMap(keyMap);

@pandao
Copy link
Owner

pandao commented Apr 21, 2015

@byhgj 经测试,确实在FF无法阻止默认的保存动作(IE不会),即使加上return false;,暂时无解,有待修正。

@pandao pandao closed this as completed May 4, 2019
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