mirror of
https://github.com/mathuo/dockview
synced 2026-08-13 10:23:44 +00:00
- pointerDragController: call getData() before mutating state so a throw
doesn't strand the controller mid-drag; document singleton scope.
- tabGroupChip dragend listener: switch to { once: true } so the
intentionally-detached listener still auto-removes.
- jest-setup: global afterEach that cancels any leftover pointer drag,
so newly-added tests can't inherit singleton state.
- docs: new strategy.mdx for dndStrategy + touch gesture model; note in
external.mdx on narrowing nativeEvent: DragEvent | PointerEvent.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
12 lines
552 B
TypeScript
12 lines
552 B
TypeScript
import '@testing-library/jest-dom';
|
|
import { PointerDragController } from './packages/dockview-core/src/dnd/pointer/pointerDragController';
|
|
|
|
// `PointerDragController` is a module-level singleton — state leaks across
|
|
// test files unless explicitly reset. Tests that drive a pointer drag end
|
|
// to end already call `cancel()` in their own beforeEach, but a global
|
|
// afterEach makes the cleanup automatic so newly-added tests can't
|
|
// accidentally inherit a half-finished drag.
|
|
afterEach(() => {
|
|
PointerDragController.getInstance().cancel();
|
|
});
|