-
Notifications
You must be signed in to change notification settings - Fork 585
Open
Labels
bugSomething isn't workingSomething isn't workingstatus: awaiting responseFurther information is requestedFurther information is requested
Description
Duplicate Check
- I have searched the opened issues and there are no duplicates
Describe the bug
Changing the tooltip value for a custom control in its before_update(), and calling update() for the control does not immediately change the tooltip in the UI. It is necessary to call update() for the tooltip to change in the UI.
Code sample
Code
import flet as ft
class CustomText(ft.Text):
def __init__(self, **kwargs):
super().__init__(**kwargs)
self.number = 0
self.size = 42
self.text_align = ft.TextAlign.CENTER
def before_update(self):
super().before_update()
self.number += 1
self.value=str(self.number)
self.tooltip=str(self.number)
def main(page: ft.Page) -> None:
number = CustomText(width=float("inf"))
page.add(number)
page.add(ft.TextButton(
text="Click to increase number",
on_click=lambda e: number.update(),
width=float("inf")
))
page.add(ft.Text(
value="The number and its tooltip are set as the same value, but the tooltip is always one behind :(",
text_align=ft.TextAlign.CENTER,
width=float("inf")
))
ft.app(main)To reproduce
- Create custom Flet control class
- In the custom class, add
before_update()function that changesself.tooltip - Call
update()on the custom control
-> Control's tooltip is not immediately updated, until you callupdate()the second time.
Expected behavior
Setting tooltip in before_update() should change it in UI immediately when update() is called, the same way it works for e.g. flet.Text.value
Screenshots / Videos
Captures
Screencast.From.2025-10-25.15-30-10.mp4
Operating System
Linux
Operating system details
Arch Linux
Flet version
0.28.3
Regression
I'm not sure / I don't know
Suggestions
No response
Logs
Additional details
No response
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingstatus: awaiting responseFurther information is requestedFurther information is requested