Commit b3873a2 1 parent 872ec7c commit b3873a2 Copy full SHA for b3873a2
File tree 6 files changed +22
-21
lines changed
6 files changed +22
-21
lines changed Original file line number Diff line number Diff line change @@ -105,6 +105,21 @@ class ClassUnderTest extends BaseGrid<TestPanel> {
105
105
}
106
106
107
107
describe ( 'baseComponentGridview' , ( ) => {
108
+ test ( 'aa' , ( ) => {
109
+ const root = document . createElement ( 'div' ) ;
110
+ const container = document . createElement ( 'div' ) ;
111
+ root . appendChild ( container ) ;
112
+
113
+ const cut = new ClassUnderTest ( container , {
114
+ orientation : Orientation . HORIZONTAL ,
115
+ proportionalLayout : true ,
116
+ } ) ;
117
+
118
+ cut . dispose ( ) ;
119
+
120
+ expect ( container . parentElement ) . toBe ( root ) ;
121
+ } ) ;
122
+
108
123
test ( 'that .layout(...) force flag works' , ( ) => {
109
124
const cut = new ClassUnderTest ( document . createElement ( 'div' ) , {
110
125
orientation : Orientation . HORIZONTAL ,
Original file line number Diff line number Diff line change @@ -156,13 +156,15 @@ export abstract class BaseGrid<T extends IGridPanelView>
156
156
}
157
157
158
158
constructor ( parentElement : HTMLElement , options : BaseGridOptions ) {
159
- super ( parentElement , options . disableAutoResizing ) ;
159
+ super ( document . createElement ( 'div' ) , options . disableAutoResizing ) ;
160
160
this . element . style . height = '100%' ;
161
161
this . element . style . width = '100%' ;
162
162
163
163
this . _classNames = new Classnames ( this . element ) ;
164
164
this . _classNames . setClassNames ( options . className ?? '' ) ;
165
165
166
+ parentElement . appendChild ( this . element ) ;
167
+
166
168
this . gridview = new Gridview (
167
169
! ! options . proportionalLayout ,
168
170
options . styles ,
Original file line number Diff line number Diff line change @@ -318,11 +318,7 @@ export const DockviewReact = React.forwardRef(
318
318
} , [ props . prefixHeaderActionsComponent ] ) ;
319
319
320
320
return (
321
- < div
322
- className = { props . className }
323
- style = { { height : '100%' , width : '100%' } }
324
- ref = { domRef }
325
- >
321
+ < div style = { { height : '100%' , width : '100%' } } ref = { domRef } >
326
322
{ portals }
327
323
</ div >
328
324
) ;
Original file line number Diff line number Diff line change @@ -126,11 +126,7 @@ export const GridviewReact = React.forwardRef(
126
126
} , [ props . components ] ) ;
127
127
128
128
return (
129
- < div
130
- className = { props . className }
131
- style = { { height : '100%' , width : '100%' } }
132
- ref = { domRef }
133
- >
129
+ < div style = { { height : '100%' , width : '100%' } } ref = { domRef } >
134
130
{ portals }
135
131
</ div >
136
132
) ;
Original file line number Diff line number Diff line change @@ -176,11 +176,7 @@ export const PaneviewReact = React.forwardRef(
176
176
} , [ props . onDidDrop ] ) ;
177
177
178
178
return (
179
- < div
180
- className = { props . className }
181
- style = { { height : '100%' , width : '100%' } }
182
- ref = { domRef }
183
- >
179
+ < div style = { { height : '100%' , width : '100%' } } ref = { domRef } >
184
180
{ portals }
185
181
</ div >
186
182
) ;
Original file line number Diff line number Diff line change @@ -126,11 +126,7 @@ export const SplitviewReact = React.forwardRef(
126
126
} , [ props . components ] ) ;
127
127
128
128
return (
129
- < div
130
- className = { props . className }
131
- style = { { height : '100%' , width : '100%' } }
132
- ref = { domRef }
133
- >
129
+ < div style = { { height : '100%' , width : '100%' } } ref = { domRef } >
134
130
{ portals }
135
131
</ div >
136
132
) ;
You can’t perform that action at this time.
0 commit comments