Skip to content

Conversation

cpsievert
Copy link
Collaborator

@cpsievert cpsievert commented May 21, 2025

#191 introduced a problem where, if the widget that is initialized by an internal as_widget() call, then it doesn't get cleaned up.

For a minimal reprex of the issue, notice how clicking the button will keep inserting new plots

import plotly.express as px
from shiny.express import input, ui

from shinywidgets import render_plotly

ui.input_action_button("redraw", "Redraw")

@render_plotly
def plot():
    input.redraw()
    return px.histogram(
        px.data.tips(),
        x="total_bill",
    )

@cpsievert cpsievert merged commit 212acf8 into main May 21, 2025
5 checks passed
@cpsievert cpsievert deleted the fix/as-widget-cleanup branch May 21, 2025 22:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant