Skip to content

Commit 3fe7086

Browse files
authored
Fix Drag and Drop Issue in Open Editors (microsoft#203701)
fix microsoft#203696
1 parent 6e47460 commit 3fe7086

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/vs/base/browser/ui/list/listView.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import { IObservableValue } from 'vs/base/common/observableValue';
2424
import { BugIndicatingError } from 'vs/base/common/errors';
2525
import { AriaRole } from 'vs/base/browser/ui/aria/aria';
2626
import { ScrollableElementChangeOptions } from 'vs/base/browser/ui/scrollbar/scrollableElementOptions';
27+
import { clamp } from 'vs/base/common/numbers';
2728

2829
interface IItem<T> {
2930
readonly id: string;
@@ -1371,7 +1372,8 @@ export class ListView<T> implements IListView<T> {
13711372
}
13721373

13731374
const relativePosition = browserEvent.offsetY / this.items[targetIndex].size;
1374-
return Math.floor(relativePosition / 0.25);
1375+
const sector = Math.floor(relativePosition / 0.25);
1376+
return clamp(sector, 0, 3);
13751377
}
13761378

13771379
private getItemIndexFromEventTarget(target: EventTarget | null): number | undefined {

0 commit comments

Comments
 (0)