You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I have a list of projects that each have a delete button with a Tooltip.
But when I press the button (the tooltip is active and showing) the text for the Tooltip gets hanging like a "ghost" text. It gets removed correct if the page reloads. It seems like since the definition of the Tooltip is removed it can't be cleaned up.
Screenshots
Hovering the delete button (with tooltip) for "Hello"
After "Hello" is deleted
Code To Reproduce
import mesop as me
projects = [
{"key": "hello", "text": "Hello", "tooltip": "This is a tooltip"},
{"key": "world", "text": "World", "tooltip": "This is another tooltip"},
]
@me.stateclass
class State:
select_message: str = "Nothing yet"
delete_message: str = "Nothing yet"
def on_reset(e: me.ClickEvent):
global projects
projects = [
{"key": "hello", "text": "Hello", "tooltip": "This is a tooltip"},
{"key": "world", "text": "World", "tooltip": "This is another tooltip"},
]
def on_select_project(e: me.ClickEvent):
state = me.state(State)
state.select_message = f"Selected: {str(e)}"
def on_delete_project(e: me.ClickEvent):
global projects
state = me.state(State)
state.delete_message = f"Deleted: {str(e)}"
projects = [p for p in projects if p["key"] != str(e.key)]
@me.page(
path="/",
title="Tooltip Bug",
)
def app():
state = me.state(State)
with me.box():
me.text(f"select_message: {state.select_message}")
me.text(f"delete_message: {state.delete_message}")
me.button(
on_click=on_reset,
label="Reset",
)
for project in projects:
with me.box():
me.text(project["text"])
with me.tooltip(message="Remove Project"):
with me.content_button(
on_click=on_delete_project,
type="icon",
key=project["key"],
):
me.icon(icon="delete_circle")
The text was updated successfully, but these errors were encountered:
Finally got a chance to take a look at this. I tested it out and it seems to be working fine now. We did recently update the Angular version (though I don't think we updated Angular Components lib), so perhaps that fixed it?
I think we also fixed an issue recently with some components not being garbage collected correctly (leading to memory leak), so perhaps this was a side effect of that.
When I run the code and press delete on Home, the tooltip for World gets activated for me. But when I move away from the delete button World, the tooltip fades away.
Describe the bug
I have a list of projects that each have a delete button with a Tooltip.
But when I press the button (the tooltip is active and showing) the text for the Tooltip gets hanging like a "ghost" text. It gets removed correct if the page reloads. It seems like since the definition of the Tooltip is removed it can't be cleaned up.
Screenshots
Hovering the delete button (with tooltip) for "Hello"
After "Hello" is deleted
Code To Reproduce
The text was updated successfully, but these errors were encountered: