Commit 08122aa 1 parent ca09ae5 commit 08122aa Copy full SHA for 08122aa
File tree 2 files changed +7
-17
lines changed
packages/dockview-core/src
2 files changed +7
-17
lines changed Original file line number Diff line number Diff line change @@ -50,8 +50,7 @@ export class DockviewGroupPanelApiImpl extends GridviewPanelApiImpl {
50
50
readonly onDidLocationChange : Event < DockviewGroupPanelFloatingChangeEvent > =
51
51
this . _onDidLocationChange . event ;
52
52
53
- private readonly _onDidActivePanelChange =
54
- new Emitter < DockviewGroupChangeEvent > ( ) ;
53
+ readonly _onDidActivePanelChange = new Emitter < DockviewGroupChangeEvent > ( ) ;
55
54
readonly onDidActivePanelChange = this . _onDidActivePanelChange . event ;
56
55
57
56
get location ( ) : DockviewGroupLocation {
@@ -140,21 +139,6 @@ export class DockviewGroupPanelApiImpl extends GridviewPanelApiImpl {
140
139
}
141
140
142
141
initialize ( group : DockviewGroupPanel ) : void {
143
- /**
144
- * TODO: Annoying initialization order caveat, find a better way to initialize and avoid needing null checks
145
- *
146
- * Due to the order on initialization we know that the model isn't defined until later in the same stack-frame of setup.
147
- * By queuing a microtask we can ensure the setup is completed within the same stack-frame, but after everything else has
148
- * finished ensuring the `model` is defined.
149
- */
150
-
151
142
this . _group = group ;
152
-
153
- queueMicrotask ( ( ) => {
154
- this . _mutableDisposable . value =
155
- this . _group ! . model . onDidActivePanelChange ( ( event ) => {
156
- this . _onDidActivePanelChange . fire ( event ) ;
157
- } ) ;
158
- } ) ;
159
143
}
160
144
}
Original file line number Diff line number Diff line change @@ -124,6 +124,12 @@ export class DockviewGroupPanel
124
124
options ,
125
125
this
126
126
) ;
127
+
128
+ this . addDisposables (
129
+ this . model . onDidActivePanelChange ( ( event ) => {
130
+ this . api . _onDidActivePanelChange . fire ( event ) ;
131
+ } )
132
+ ) ;
127
133
}
128
134
129
135
override focus ( ) : void {
You can’t perform that action at this time.
0 commit comments