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:
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: