【问题标题】:summernote cursor position is not working for mesummernote 光标位置对我不起作用
【发布时间】:2023-01-31 12:57:01
【问题描述】:

任何人都可以告诉我如何将光标移动到特定按键上的下一个索引

我在 summernote 中使用这个回调

onKeyup: (e) => {
              
              // let abc = e.srcElement.selectionEnd;
              const collection = $('.procedure').summernote(
                'editor.getLastRange'
              );
              let a = str.search(collection.sc.nodeValue);
              let b = str.substr(0, a + collection.so);
              let c = b.search(':');
              // console.log(abc);
            },

我想将光标移动到下一个 ':'

【问题讨论】:

    标签: javascript typescript summernote


    【解决方案1】:

    我在这里也遇到了一些麻烦。我认为我们应该选择一系列容器,然后将光标插入那里。 来自 Summernote ref,

    $('#summernote').summernote('editor.setLastRange', range.createFromNodeAfter(node).select());
    

    但我不知道如何实施它们。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-10-24
      • 2016-03-02
      • 1970-01-01
      • 1970-01-01
      • 2018-06-05
      • 2017-07-12
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多