dockview-core 6.0.6 → 6.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * dockview-core
3
- * @version 6.0.6
3
+ * @version 6.0.7
4
4
  * @link https://github.com/mathuo/dockview
5
5
  * @license MIT
6
6
  */
@@ -7332,8 +7332,23 @@
7332
7332
  new PanelTransfer(this.accessor.id, this.group.id, null, tabGroup.id),
7333
7333
  ], PanelTransfer.prototype);
7334
7334
  const iframes = disableIframePointEvents();
7335
+ // The dragend listener on `_tabsList` is unreachable for chip
7336
+ // drags because cross-group drops detach the chip from the DOM
7337
+ // before dragend fires (the source tab group becomes empty, so
7338
+ // `_positionChipForGroup` removes the chip element). Without
7339
+ // bubbling, the tabsList listener never runs and `_animState`,
7340
+ // `_chipDragCleanup`, and the dragging CSS classes leak. Listen
7341
+ // directly on the chip element so cleanup happens regardless of
7342
+ // whether it's still attached. (Issue #1254.)
7343
+ const chipElement = chip.element;
7344
+ const onChipDragEnd = () => {
7345
+ chipElement.removeEventListener('dragend', onChipDragEnd);
7346
+ this.resetDragAnimation();
7347
+ };
7348
+ chipElement.addEventListener('dragend', onChipDragEnd);
7335
7349
  this._chipDragCleanup = {
7336
7350
  dispose: () => {
7351
+ chipElement.removeEventListener('dragend', onChipDragEnd);
7337
7352
  panelTransfer.clearData(PanelTransfer.prototype);
7338
7353
  iframes.release();
7339
7354
  },
@@ -731,8 +731,23 @@ export class Tabs extends CompositeDisposable {
731
731
  new PanelTransfer(this.accessor.id, this.group.id, null, tabGroup.id),
732
732
  ], PanelTransfer.prototype);
733
733
  const iframes = disableIframePointEvents();
734
+ // The dragend listener on `_tabsList` is unreachable for chip
735
+ // drags because cross-group drops detach the chip from the DOM
736
+ // before dragend fires (the source tab group becomes empty, so
737
+ // `_positionChipForGroup` removes the chip element). Without
738
+ // bubbling, the tabsList listener never runs and `_animState`,
739
+ // `_chipDragCleanup`, and the dragging CSS classes leak. Listen
740
+ // directly on the chip element so cleanup happens regardless of
741
+ // whether it's still attached. (Issue #1254.)
742
+ const chipElement = chip.element;
743
+ const onChipDragEnd = () => {
744
+ chipElement.removeEventListener('dragend', onChipDragEnd);
745
+ this.resetDragAnimation();
746
+ };
747
+ chipElement.addEventListener('dragend', onChipDragEnd);
734
748
  this._chipDragCleanup = {
735
749
  dispose: () => {
750
+ chipElement.removeEventListener('dragend', onChipDragEnd);
736
751
  panelTransfer.clearData(PanelTransfer.prototype);
737
752
  iframes.release();
738
753
  },
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * dockview-core
3
- * @version 6.0.6
3
+ * @version 6.0.7
4
4
  * @link https://github.com/mathuo/dockview
5
5
  * @license MIT
6
6
  */
@@ -7328,8 +7328,23 @@ class Tabs extends CompositeDisposable {
7328
7328
  new PanelTransfer(this.accessor.id, this.group.id, null, tabGroup.id),
7329
7329
  ], PanelTransfer.prototype);
7330
7330
  const iframes = disableIframePointEvents();
7331
+ // The dragend listener on `_tabsList` is unreachable for chip
7332
+ // drags because cross-group drops detach the chip from the DOM
7333
+ // before dragend fires (the source tab group becomes empty, so
7334
+ // `_positionChipForGroup` removes the chip element). Without
7335
+ // bubbling, the tabsList listener never runs and `_animState`,
7336
+ // `_chipDragCleanup`, and the dragging CSS classes leak. Listen
7337
+ // directly on the chip element so cleanup happens regardless of
7338
+ // whether it's still attached. (Issue #1254.)
7339
+ const chipElement = chip.element;
7340
+ const onChipDragEnd = () => {
7341
+ chipElement.removeEventListener('dragend', onChipDragEnd);
7342
+ this.resetDragAnimation();
7343
+ };
7344
+ chipElement.addEventListener('dragend', onChipDragEnd);
7331
7345
  this._chipDragCleanup = {
7332
7346
  dispose: () => {
7347
+ chipElement.removeEventListener('dragend', onChipDragEnd);
7333
7348
  panelTransfer.clearData(PanelTransfer.prototype);
7334
7349
  iframes.release();
7335
7350
  },