Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 修改全选删除时,井号无法删除问题 #19

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

zhtzhtx
Copy link

@zhtzhtx zhtzhtx commented Apr 4, 2023

#16 (comment)

改动点:

  1. 修改在 RENDER MODE 模式中使用全选时,首行标题井号无法删除问题,在 getNodeSource_ 方法中判断是否有文本标记符(.editor-marker),如果有则取父节点的 preIndexStr

开发逻辑:
当选中节点具有 marker 时,如果光标在节点开头(offset = 0),则将光标位置重置为 marker 之前。由于重置光标会触发 selectionchange 事件,需要进行判断如果即将更新到 dom 的选区和当前 dom 本身的选区一致,则不需操作dom。

影响范围:

  1. src/view/base-view.ts: 203
  2. src/utils/hasClass.ts

发布时间:
2023.4.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant