We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 864212b commit 02409f2Copy full SHA for 02409f2
core/src/components/reorder-group/reorder-group.tsx
@@ -245,17 +245,16 @@ export class ReorderGroup implements ComponentInterface {
245
246
private itemIndexForTop(deltaY: number): number {
247
const heights = this.cachedHeights;
248
- let i = 0;
249
250
// TODO: since heights is a sorted array of integers, we can do
251
// speed up the search using binary search. Remember that linear-search is still
252
// faster than binary-search for small arrays (<64) due CPU branch misprediction.
253
- for (i = 0; i < heights.length; i++) {
+ for (let i = 0; i < heights.length; i++) {
254
if (heights[i] > deltaY) {
255
- break;
+ return i;
256
}
257
258
- return i;
+ return heights.length - 1;
259
260
261
/********* DOM WRITE ********* */
0 commit comments