Explorar o código

let .tooltip() use a real Tooltip element (fixes #2554)

Falko Schindler hai 1 ano
pai
achega
24cec107f4
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      nicegui/element.py

+ 2 - 2
nicegui/element.py

@@ -383,9 +383,9 @@ class Element(Visibility):
 
         :param text: text of the tooltip
         """
+        from .elements.tooltip import Tooltip  # pylint: disable=import-outside-toplevel, cyclic-import
         with self:
-            tooltip = Element('q-tooltip')
-            tooltip._text = text  # pylint: disable=protected-access
+            Tooltip(text)
         return self
 
     def on(self,