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
相关产品推荐
相关产品推荐

