File tree Expand file tree Collapse file tree 3 files changed +13
-1
lines changed Expand file tree Collapse file tree 3 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,10 @@ All notable changes to shinywidgets will be documented in this file.
55The format is based on [ Keep a Changelog] ( https://keepachangelog.com/en/1.0.0/ ) ,
66and this project adheres to [ Semantic Versioning] ( https://semver.org/spec/v2.0.0.html ) .
77
8+ ## [ UNRELEASED]
9+
10+ * Eliminate the possibility of a single ` @render_widget ` output from keeping a view of prior renders. (#196 )
11+
812## [ 0.6.1] - 2025-05-21
913
1014* Fixed an issue introduced by v0.6.0 where cleanup wasn't happening when it should be. (#195 )
Original file line number Diff line number Diff line change @@ -103,6 +103,14 @@ class IPyWidgetOutput extends Shiny.OutputBinding {
103103 const view = await manager . create_view ( model , { } ) ;
104104 await manager . display_view ( view , { el : el } ) ;
105105
106+ // Don't allow more than one .lmWidget container, which can happen
107+ // when the view is displayed more than once
108+ // N.B. It's probably better to get view(s) from m.views and .remove() them,
109+ // but empirically, this seems to work better
110+ while ( el . childNodes . length > 1 ) {
111+ el . removeChild ( el . childNodes [ 0 ] ) ;
112+ }
113+
106114 // The ipywidgets container (.lmWidget)
107115 const lmWidget = el . children [ 0 ] as HTMLElement ;
108116
You can’t perform that action at this time.
0 commit comments