Explorar el Código

Merge pull request #2603 from Johannes-/fix/client-remove-elements

fix: order of remove elements
Falko Schindler hace 1 año
padre
commit
939efba0c7
Se han modificado 1 ficheros con 2 adiciones y 2 borrados
  1. 2 2
      nicegui/client.py

+ 2 - 2
nicegui/client.py

@@ -294,12 +294,12 @@ class Client:
         """Remove the given elements from the client."""
         binding.remove(elements)
         element_ids = [element.id for element in elements]
-        for element_id in element_ids:
-            del self.elements[element_id]
         for element in elements:
             element._handle_delete()  # pylint: disable=protected-access
             element._deleted = True  # pylint: disable=protected-access
             self.outbox.enqueue_delete(element)
+        for element_id in element_ids:
+            del self.elements[element_id]
 
     def remove_all_elements(self) -> None:
         """Remove all elements from the client."""