Browse Source

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

Falko Schindler 2 years ago
parent
commit
f769a6aa22
1 changed files with 2 additions and 0 deletions
  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)