每当我创建编辑器的另一个实例时(在我的例子中,通过 onkeypress 事件),当我创建新编辑器时,我会失去对正在输入的编辑器的关注。如何防止所有编辑对任何事件失去注意力?
Quill 有一个focus()为此调用的方法。
var quill = new Quill('#editor', {
theme: 'snow'
});
// This will focus the instance of quill editor
quill.focus()
Run Code Online (Sandbox Code Playgroud)
setTimeout(() => {
quill.focus();
})
Run Code Online (Sandbox Code Playgroud)
会起作用的
| 归档时间: |
|
| 查看次数: |
4096 次 |
| 最近记录: |