Set Value for ace editor without selecting the whole editor

前端 未结 6 626
臣服心动
臣服心动 2021-02-06 20:04

So you can set value of an ace editor with setValue but after setting the value, the editor will select the whole value of the editor. How do you disable this? This

6条回答
  •  谎友^
    谎友^ (楼主)
    2021-02-06 20:49

    You can even use clearSelection() after you do an setValue();

    editor.setValue("Hello World");
    editor.clearSelection(); // This will remove the highlight over the text
    

提交回复
热议问题