Fix:修复搜索内容为全部替换内容的子串时连续点击全部替换搜索结果异常的问题

This commit is contained in:
街角小林 2024-11-12 17:53:42 +08:00
parent ac5bb1d684
commit b1303ce7a5
3 changed files with 5 additions and 0 deletions

View File

@ -515,4 +515,8 @@ const mindMap = new MindMap({
<img src="./web/src/assets/avatar/一亩三.jpg" style="width: 50px;height: 50px;" />
<span>一亩三</span>
</span>
<span>
<img src="./web/src/assets/avatar/xbkkjbs0246658.png" style="width: 50px;height: 50px;" />
<span>xbkkjbs0246658</span>
</span>
</p>

View File

@ -257,6 +257,7 @@ class Search {
replaceText = String(replaceText)
// 如果当前搜索文本是替换文本的子串,那么该节点还是符合搜索结果的
const keep = replaceText.includes(this.searchText)
this.notResetSearchText = true
const hasRichTextPlugin = this.mindMap.renderer.hasRichTextPlugin()
this.matchNodeList.forEach(node => {
const text = this.getReplacedText(node, this.searchText, replaceText)

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB