File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
src/vs/base/browser/ui/list Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ import { IObservableValue } from 'vs/base/common/observableValue';
24
24
import { BugIndicatingError } from 'vs/base/common/errors' ;
25
25
import { AriaRole } from 'vs/base/browser/ui/aria/aria' ;
26
26
import { ScrollableElementChangeOptions } from 'vs/base/browser/ui/scrollbar/scrollableElementOptions' ;
27
+ import { clamp } from 'vs/base/common/numbers' ;
27
28
28
29
interface IItem < T > {
29
30
readonly id : string ;
@@ -1371,7 +1372,8 @@ export class ListView<T> implements IListView<T> {
1371
1372
}
1372
1373
1373
1374
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 ) ;
1375
1377
}
1376
1378
1377
1379
private getItemIndexFromEventTarget ( target : EventTarget | null ) : number | undefined {
You can’t perform that action at this time.
0 commit comments