File tree Expand file tree Collapse file tree 2 files changed +7
-17
lines changed
packages/dockview-core/src Expand file tree Collapse file tree 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 {
5050 readonly onDidLocationChange : Event < DockviewGroupPanelFloatingChangeEvent > =
5151 this . _onDidLocationChange . event ;
5252
53- private readonly _onDidActivePanelChange =
54- new Emitter < DockviewGroupChangeEvent > ( ) ;
53+ readonly _onDidActivePanelChange = new Emitter < DockviewGroupChangeEvent > ( ) ;
5554 readonly onDidActivePanelChange = this . _onDidActivePanelChange . event ;
5655
5756 get location ( ) : DockviewGroupLocation {
@@ -140,21 +139,6 @@ export class DockviewGroupPanelApiImpl extends GridviewPanelApiImpl {
140139 }
141140
142141 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-
151142 this . _group = group ;
152-
153- queueMicrotask ( ( ) => {
154- this . _mutableDisposable . value =
155- this . _group ! . model . onDidActivePanelChange ( ( event ) => {
156- this . _onDidActivePanelChange . fire ( event ) ;
157- } ) ;
158- } ) ;
159143 }
160144}
Original file line number Diff line number Diff line change @@ -124,6 +124,12 @@ export class DockviewGroupPanel
124124 options ,
125125 this
126126 ) ;
127+
128+ this . addDisposables (
129+ this . model . onDidActivePanelChange ( ( event ) => {
130+ this . api . _onDidActivePanelChange . fire ( event ) ;
131+ } )
132+ ) ;
127133 }
128134
129135 override focus ( ) : void {
You can’t perform that action at this time.
0 commit comments