File tree 1 file changed +10
-2
lines changed
1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ export class Search {
33
33
private text : Clutter . Text ;
34
34
private widgets : Array < St . Widget > ;
35
35
private scroller : St . Widget ;
36
+ private children_to_abandon : any = null ;
36
37
37
38
activate_id : ( index : number ) => void = ( ) => { }
38
39
cancel : ( ) => void = ( ) => { }
@@ -193,8 +194,7 @@ export class Search {
193
194
}
194
195
195
196
clear ( ) {
196
- this . list . remove_all_children ( ) ;
197
- this . list . hide ( ) ;
197
+ this . children_to_abandon = ( this . list as any ) . get_children ( ) ;
198
198
this . widgets = [ ] ;
199
199
this . active_id = 0 ;
200
200
}
@@ -299,6 +299,14 @@ export class Search {
299
299
300
300
this . widgets . push ( widget ) ;
301
301
this . list . add ( widget ) ;
302
+
303
+ if ( this . children_to_abandon ) {
304
+ for ( const child of this . children_to_abandon ) {
305
+ child . destroy ( ) ;
306
+ }
307
+ this . children_to_abandon = null
308
+ }
309
+
302
310
this . list . show ( ) ;
303
311
304
312
const vscroll = ( this . scroller as any ) . get_vscroll_bar ( )
You can’t perform that action at this time.
0 commit comments