fix: minor updated the region lasso selection behavior

This commit is contained in:
Xiaohan-Tian
2026-05-04 18:34:29 -07:00
parent f323f1a6b5
commit a2f12ca961
3 changed files with 51 additions and 3 deletions
@@ -119,6 +119,17 @@ describe('TrackGridPanel lasso selection', () => {
expect(onRegionLassoSelection).toHaveBeenCalledWith(['region-b', 'region-a'], { shiftKey: false });
});
it('uses the closest intersected region as primary when release is outside all regions', () => {
const { container, onRegionLassoSelection } = renderPanel();
const firstTrackGrid = container.querySelector('[data-test-id="track-grid-1"]') as HTMLDivElement;
fireEvent.mouseDown(firstTrackGrid, { clientX: 10, clientY: 10, button: 0 });
fireEvent.mouseMove(document, { clientX: 150, clientY: 170 });
fireEvent.mouseUp(document, { clientX: 150, clientY: 170 });
expect(onRegionLassoSelection).toHaveBeenCalledWith(['region-a', 'region-b'], { shiftKey: false });
});
it('clears selection on a plain empty-space click', () => {
const { container, onRegionLassoSelection } = renderPanel();
const firstTrackGrid = container.querySelector('[data-test-id="track-grid-1"]') as HTMLDivElement;