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

问一下怎么取消光标自动对焦编辑器上? #74

Closed
shaginblog opened this issue Apr 27, 2015 · 6 comments
Closed

问一下怎么取消光标自动对焦编辑器上? #74

shaginblog opened this issue Apr 27, 2015 · 6 comments

Comments

@shaginblog
Copy link

No description provided.

@pandao
Copy link
Owner

pandao commented Apr 27, 2015

@9v-kz 没有办法,除非是只读模式。

CodeMirror论坛上有一个回答,但不行:

CM实例.getInputField().blur();

@shaginblog
Copy link
Author

@pandao 哦,那希望下一个版本改善一下,拜托了,网站是多用户系统,每次打开内容内页光标都在编辑器上 感觉就像强迫用户提交评论一样,很不友好。

@pandao
Copy link
Owner

pandao commented Apr 27, 2015

@9v-kz 找到一个临时解决方案,打开 editormd.js,修改如下:

# 在 108行(即 autoCloseTags : true,) 前面加一行
autoFoucs : true,

找到 620 行将 autofocus : true, 修改为 autofocus : settings.autoFoucs,

然后配置:

# 新版本可以通过这样取消自动 focus
var editor = editormd('xxxx', {
    autoFoucs : false
});

@pandao
Copy link
Owner

pandao commented May 6, 2015

@9v-kz @jimmykuu fixed @v1.4.3 .

@pandao pandao closed this as completed May 6, 2015
@shaginblog
Copy link
Author

@pandao 谢谢

@forecho
Copy link

forecho commented Oct 4, 2018

@9v-kz 找到一个临时解决方案,打开 editormd.js,修改如下:

# 在 108行(即 autoCloseTags : true,) 前面加一行
autoFoucs : true,

找到 620 行将 autofocus : true, 修改为 autofocus : settings.autoFoucs,

然后配置:

# 新版本可以通过这样取消自动 focus
var editor = editormd('xxxx', {
    autoFoucs : false
});

写错了吧?应该是:

# 新版本可以通过这样取消自动 focus
var editor = editormd('xxxx', {
    autoFocus : false
});

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

3 participants