You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Quill Editor输入时光标定位在首字符后方的问题及jQuery修复方案

修复Quill编辑器聚焦时光标自动跳转到首字符后的问题

当使用Quill编辑器时,若遇到输入时光标自动定位在首字符后方的问题,可通过以下jQuery方案解决:

$('.quill').each((i, q) => {
  new Quill(q, {
    modules: {
      toolbar: toolbarOptions
    },
    theme: 'snow',
    placeholder: 'Type here...',
  });  
}).on('focus', (e) => {
  $(this).text($(this).text().substring($(this).text().length, -1)); // 核心修复代码
});

该方案可适配React、Angular或Vue框架。

内容的提问来源于stack exchange,提问作者richardwhitney

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.16 12:27:02