@@ -103,27 +103,28 @@ class IPyWidgetOutput extends Shiny.OutputBinding {
103
103
}
104
104
105
105
// Only carry the potential to fill (i.e., add fill classes)
106
- // if `output_widget(fillable=True)`
107
- if ( ! el . classList . contains ( "html-fill-container" ) ) return ;
106
+ // if `output_widget(fillable=True)` _and_ the widget wants to fill
107
+ const fill = data . fill && el . classList . contains ( "html-fill-container" ) ;
108
108
109
- // And only fill if the `Widget.layout.height` isn't set
110
- if ( ! data . fill ) return ;
111
-
112
- // Make ipywidgets container (.lmWidget) a fill carrier
113
- // el should already be a fill carrier (done during markup generation)
109
+ // The ipywidgets container (.lmWidget)
114
110
const lmWidget = el . children [ 0 ] as HTMLElement ;
115
- lmWidget ?. classList . add ( "html-fill-container" , "html-fill-item" ) ;
116
-
117
- // lmWidget's children is the actual widget implementation.
118
- // Ideally this would be a single element, but some widget
119
- // implementations (e.g., pydeck, altair) have multiple direct children.
120
- // It seems relatively safe to make all of them fill items, but there's
121
- // at least one case where it's problematic (pydeck)
122
- lmWidget . childNodes . forEach ( ( child ) => {
123
- if ( ! ( child instanceof HTMLElement ) ) return ;
124
- if ( child . classList . contains ( "deckgl-ui-elements-overlay" ) ) return ;
125
- child . classList . add ( "html-fill-item" ) ;
126
- } ) ;
111
+
112
+ if ( fill ) {
113
+ // Make lmWidget a fill carrier
114
+ // el should already be a fill carrier (done during markup generation)
115
+ lmWidget ?. classList . add ( "html-fill-container" , "html-fill-item" ) ;
116
+
117
+ // lmWidget's children is the actual widget implementation.
118
+ // Ideally this would be a single element, but some widget
119
+ // implementations (e.g., pydeck, altair) have multiple direct children.
120
+ // It seems relatively safe to make all of them fill items, but there's
121
+ // at least one case where it's problematic (pydeck)
122
+ lmWidget . childNodes . forEach ( ( child ) => {
123
+ if ( ! ( child instanceof HTMLElement ) ) return ;
124
+ if ( child . classList . contains ( "deckgl-ui-elements-overlay" ) ) return ;
125
+ child . classList . add ( "html-fill-item" ) ;
126
+ } ) ;
127
+ }
127
128
128
129
this . _maybeResize ( lmWidget ) ;
129
130
}
0 commit comments