如何在 Prosemirror 编辑器变为可编辑后立即显示插入符号?

问题描述

我有一个用例,其中 ProseMirror 编辑器起初不可编辑(只读模式)。用户双击编辑器后,编辑器变为可编辑状态。

/**
 * The schema is defined to have paragraphs within a document.
 */

const state = EditorState.create({
  schema,doc: schema.nodeFromJSON(emptyDoc),});

const view = new EditorView(document.getElementById('editor'),{
  state,editable: () => false,});


/**
 * Once the user double clicks the editor,we enable it to be editable.
 */
view.setProps({
  editable: () => true,});

这一切正常。这里的问题是插入符号在变为可编辑时不会立即可见。当然,我可以点击文字,它就会变得可见。

但是,我希望它立即显示在双击的位置。这可能吗?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)