Browse Source

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

Falko Schindler 1 year ago
parent
commit
24cec107f4
1 changed files with 2 additions and 2 deletions
  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,