@@ -62,7 +62,7 @@ export class QueryResultsRenderer {
6262 protected queryType : string ; // whilst there is only one query type, there is no point logging this value
6363 public queryResult : QueryResult ;
6464 public filteredQueryResult : QueryResult ;
65- public filterString : string = '' ;
65+ private _filterString : string = '' ;
6666
6767 constructor (
6868 className : string ,
@@ -120,6 +120,10 @@ export class QueryResultsRenderer {
120120 this . markdownRenderer = new MarkdownQueryResultsRenderer ( getters ) ;
121121 }
122122
123+ public get filterString ( ) : string {
124+ return this . _filterString ;
125+ }
126+
123127 private makeQueryFromSourceAndTasksFile ( ) {
124128 return getQueryForQueryRenderer ( this . source , GlobalQuery . getInstance ( ) , this . tasksFile ) ;
125129 }
@@ -192,7 +196,7 @@ export class QueryResultsRenderer {
192196 const label = createAndAppendElement ( 'label' , toolbar ) ;
193197 setIcon ( label , 'lucide-filter' ) ;
194198 const searchBox = createAndAppendElement ( 'input' , label ) ;
195- searchBox . value = this . filterString ;
199+ searchBox . value = this . _filterString ;
196200 searchBox . placeholder = 'Filter by description...' ;
197201 setTooltip ( searchBox , 'Filter results' ) ;
198202 searchBox . addEventListener ( 'input' , async ( ) => {
@@ -202,7 +206,7 @@ export class QueryResultsRenderer {
202206 }
203207
204208 public async applySearchBoxFilterAndRerender ( filterString : string , content : HTMLDivElement ) {
205- this . filterString = filterString ;
209+ this . _filterString = filterString ;
206210
207211 this . filterResults ( ) ;
208212
@@ -223,7 +227,7 @@ export class QueryResultsRenderer {
223227
224228 private filterResults ( ) {
225229 const { filter, error } = new DescriptionField ( ) . createFilterOrErrorMessage (
226- 'description includes ' + this . filterString ,
230+ 'description includes ' + this . _filterString ,
227231 ) ;
228232 if ( error ) {
229233 // If we can't create a filter, just silently show all the matching tasks
0 commit comments