Skip to content

Commit 26f7149

Browse files
committed
fix: Enhance search handling in ApexLogTimeline to check for active container and empty search text
1 parent c517c93 commit 26f7149

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

log-viewer/src/features/timeline/optimised/ApexLogTimeline.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,12 +228,16 @@ export class ApexLogTimeline {
228228
*/
229229
private handleFind = (event: Event): void => {
230230
// Only process if this timeline instance is active
231-
if (!this.container || !this.container.isConnected) {
231+
if (!this.container || !this.container.isConnected || !this.container.clientHeight) {
232232
return;
233233
}
234234

235235
const customEvent = event as CustomEvent<FindEventDetail>;
236236
const { text, options } = customEvent.detail;
237+
if (!text) {
238+
this.handleFindClose();
239+
return;
240+
}
237241

238242
// Convert search text to predicate function (thin facade)
239243
const caseSensitive = options.matchCase;
@@ -293,6 +297,8 @@ export class ApexLogTimeline {
293297

294298
// Clear search state (FlameChart handles render)
295299
this.flamechart.clearSearch();
300+
301+
document.dispatchEvent(new CustomEvent('lv-find-results', { detail: { totalMatches: 0 } }));
296302
};
297303

298304
/**

0 commit comments

Comments
 (0)