@@ -89,6 +89,9 @@ def __init__(
8989 def _is_isolated (self ):
9090 return False
9191
92+ def _build (self ):
93+ pass
94+
9295 def did_mount (self ):
9396 pass
9497
@@ -270,13 +273,16 @@ def clean(self):
270273 self ._remove_control_recursively (self .__page .index , child )
271274 return self .__page ._send_command ("clean" , [self .uid ])
272275
273- def build_update_commands (self , index , added_controls , commands ):
276+ def build_update_commands (self , index , added_controls , commands , isolated = False ):
274277 update_cmd = self ._get_cmd_attrs (update = True )
275278
276279 if len (update_cmd .attrs ) > 0 :
277280 update_cmd .name = "set"
278281 commands .append (update_cmd )
279282
283+ if isolated :
284+ return
285+
280286 # go through children
281287 previous_children = self .__previous_children
282288 current_children = self ._get_children ()
@@ -312,8 +318,9 @@ def build_update_commands(self, index, added_controls, commands):
312318 # unchanged control
313319 for h in previous_ints [a1 :a2 ]:
314320 ctrl = hashes [h ]
315- if not ctrl ._is_isolated ():
316- ctrl .build_update_commands (index , added_controls , commands )
321+ ctrl .build_update_commands (
322+ index , added_controls , commands , isolated = ctrl ._is_isolated ()
323+ )
317324 n += 1
318325 elif tag == "replace" :
319326 ids = []
@@ -326,6 +333,7 @@ def build_update_commands(self, index, added_controls, commands):
326333 for h in current_ints [b1 :b2 ]:
327334 # add
328335 ctrl = hashes [h ]
336+ ctrl ._build ()
329337 innerCmds = ctrl .get_cmd_str (
330338 index = index , added_controls = added_controls
331339 )
@@ -343,6 +351,7 @@ def build_update_commands(self, index, added_controls, commands):
343351 # add
344352 for h in current_ints [b1 :b2 ]:
345353 ctrl = hashes [h ]
354+ ctrl ._build ()
346355 innerCmds = ctrl .get_cmd_str (
347356 index = index , added_controls = added_controls
348357 )
0 commit comments