Преглед на файлове

hide q-notify view (element should not occupy space) and remove it afterwards (DOM should not grow with every notification)

Falko Schindler преди 2 години
родител
ревизия
f769a6aa22
променени са 1 файла, в които са добавени 2 реда и са изтрити 0 реда
  1. 2 0
      nicegui/elements/notify.py

+ 2 - 0
nicegui/elements/notify.py

@@ -18,9 +18,11 @@ class Notify(Element):
         view = jp.QNotify(message=message, position=position, closeBtn=close_button, temp=False)
 
         super().__init__(view)
+        self.visible = False
         create_task(self.notify_async(), name='notify_async')
 
     async def notify_async(self):
         self.view.notify = True
         await self.parent_view.update()
         self.view.notify = False
+        self.parent_view.remove_component(self.view)