File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -247,14 +247,14 @@ export class AnalysisView extends LitElement {
247247 this . totalMatches = result . totalMatches ;
248248 this . findMap = result . matchIndexes ;
249249
250- if ( ! clearHighlights ) {
250+ if ( ! clearHighlights && isTableVisible ) {
251251 document . dispatchEvent (
252252 new CustomEvent ( 'lv-find-results' , { detail : { totalMatches : result . totalMatches } } ) ,
253253 ) ;
254254 }
255255 }
256256
257- if ( this . totalMatches <= 0 ) {
257+ if ( this . totalMatches <= 0 || ! isTableVisible ) {
258258 return ;
259259 }
260260 this . blockClearHighlights = true ;
Original file line number Diff line number Diff line change @@ -395,15 +395,15 @@ export class CalltreeView extends LitElement {
395395 this . totalMatches = result . totalMatches ;
396396 this . findMap = result . matchIndexes ;
397397
398- if ( ! clearHighlights ) {
398+ if ( ! clearHighlights && isTableVisible ) {
399399 document . dispatchEvent (
400400 new CustomEvent ( 'lv-find-results' , { detail : { totalMatches : result . totalMatches } } ) ,
401401 ) ;
402402 }
403403 }
404404
405405 // Highlight the current row and reset the previous or next depending on whether we are stepping forward or back.
406- if ( this . totalMatches <= 0 ) {
406+ if ( this . totalMatches <= 0 || ! isTableVisible ) {
407407 return ;
408408 }
409409 this . blockClearHighlights = true ;
Original file line number Diff line number Diff line change @@ -69,14 +69,12 @@ export class DMLView extends LitElement {
6969
7070 document . addEventListener ( 'lv-find' , this . _findEvt ) ;
7171 document . addEventListener ( 'lv-find-close' , this . _findEvt ) ;
72- document . addEventListener ( 'lv-find-match' , this . _findEvt ) ;
7372 }
7473
7574 disconnectedCallback ( ) : void {
7675 super . disconnectedCallback ( ) ;
7776 document . removeEventListener ( 'lv-find' , this . _findEvt ) ;
7877 document . removeEventListener ( 'lv-find-close' , this . _findEvt ) ;
79- document . removeEventListener ( 'lv-find-match' , this . _findEvt ) ;
8078 }
8179
8280 updated ( changedProperties : PropertyValues ) : void {
@@ -233,10 +231,6 @@ export class DMLView extends LitElement {
233231 }
234232
235233 const newFindArgs = JSON . parse ( JSON . stringify ( e . detail ) ) ;
236- if ( ! isTableVisible ) {
237- newFindArgs . text = '' ;
238- }
239-
240234 const newSearch =
241235 newFindArgs . text !== this . findArgs . text ||
242236 newFindArgs . options . matchCase !== this . findArgs . options ?. matchCase ;
Original file line number Diff line number Diff line change @@ -45,6 +45,13 @@ export class DatabaseView extends LitElement {
4545 document . addEventListener ( 'lv-find' , this . _findHandler as EventListener ) ;
4646 }
4747
48+ disconnectedCallback ( ) : void {
49+ super . disconnectedCallback ( ) ;
50+ document . removeEventListener ( 'db-find-results' , this . _findResults as EventListener ) ;
51+ document . removeEventListener ( 'lv-find-match' , this . _findHandler as EventListener ) ;
52+ document . removeEventListener ( 'lv-find' , this . _findHandler as EventListener ) ;
53+ }
54+
4855 static styles = [
4956 globalStyles ,
5057 css `
Original file line number Diff line number Diff line change @@ -80,14 +80,12 @@ export class SOQLView extends LitElement {
8080
8181 document . addEventListener ( 'lv-find' , this . _findEvt ) ;
8282 document . addEventListener ( 'lv-find-close' , this . _findEvt ) ;
83- document . addEventListener ( 'lv-find-match' , this . _findEvt ) ;
8483 }
8584
8685 disconnectedCallback ( ) : void {
8786 super . disconnectedCallback ( ) ;
8887 document . removeEventListener ( 'lv-find' , this . _findEvt ) ;
8988 document . removeEventListener ( 'lv-find-close' , this . _findEvt ) ;
90- document . removeEventListener ( 'lv-find-match' , this . _findEvt ) ;
9189 }
9290
9391 updated ( changedProperties : PropertyValues ) : void {
@@ -595,7 +593,7 @@ export class SOQLView extends LitElement {
595593
596594 document . dispatchEvent (
597595 new CustomEvent ( 'db-find-results' , {
598- detail : { totalMatches : this . totalMatches , type : 'dml ' } ,
596+ detail : { totalMatches : this . totalMatches , type : 'soql ' } ,
599597 } ) ,
600598 ) ;
601599 }
Original file line number Diff line number Diff line change @@ -513,18 +513,24 @@ export class Find extends Module {
513513 return String ( value ?? '' ) ;
514514 }
515515
516+ // Fall back to the raw field value when the formatter result has no
517+ // extractable text. This happens for custom-element HTML strings like
518+ // <call-stack> whose content renders via shadow DOM — in a detached
519+ // element they never connect, so textContent is empty.
520+ const fallback = String ( value ?? '' ) ;
521+
516522 if ( typeof result === 'string' ) {
517523 if ( result . includes ( '<' ) && result . includes ( '>' ) ) {
518524 const mockElem = this . _mockSearchElem ;
519525 mockElem . innerHTML = result ;
520526 const text = mockElem . textContent ?? '' ;
521527 mockElem . textContent = '' ;
522- return text ;
528+ return text || fallback ;
523529 }
524530
525531 return result ;
526532 }
527533
528- return result ?. textContent ?? '' ;
534+ return result ?. textContent || fallback ;
529535 }
530536}
You can’t perform that action at this time.
0 commit comments