Skip to content

Commit 01b63f7

Browse files
committed
fix(pages): fix find and replace with collapsed notes
1 parent 2d06507 commit 01b63f7

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

apps/client/src/code/pages/page/elems/find-and-replace.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,8 @@ export class PageFindAndReplace {
115115
editor.commands.setFindTerm('');
116116
}
117117
}
118+
119+
this.react.resultCount = 0;
118120
}
119121
}
120122

@@ -137,6 +139,22 @@ export class PageFindAndReplace {
137139
return;
138140
}
139141

142+
let parent = elemInfo.elem.react.region;
143+
144+
while (parent?.type === 'note') {
145+
if (parent.react.collapsing.collapsed) {
146+
parent.react.collapsing.collapsed = false;
147+
}
148+
149+
parent = parent.react.region;
150+
}
151+
152+
if (elemInfo.elem?.type === 'note' && this.editorIndex > 0) {
153+
if (elemInfo.elem.react.collapsing.collapsed) {
154+
elemInfo.elem.react.collapsing.collapsed = false;
155+
}
156+
}
157+
140158
const editor = elemInfo.editors[this.editorIndex];
141159

142160
if (editor == null) {
@@ -272,6 +290,8 @@ export class PageFindAndReplace {
272290
}
273291
}
274292
}
293+
294+
this.updateResultCount();
275295
}
276296
}
277297

0 commit comments

Comments
 (0)