Skip to content

Commit

Permalink
ci: apply automated fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
autofix-ci[bot] authored Dec 16, 2024
1 parent eb6d421 commit bd21dd9
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions packages/virtual-core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -851,7 +851,7 @@ export class Virtualizer<
}

if (align === 'end') {
toOffset -= size
toOffset -= size
}

const scrollSizeProp = this.options.horizontal
Expand Down Expand Up @@ -889,15 +889,28 @@ export class Virtualizer<
}
}

const centerOffset = item.start - this.options.scrollPaddingStart + (item.size - size) / 2
const centerOffset =
item.start - this.options.scrollPaddingStart + (item.size - size) / 2

switch (align) {
case 'center':
return [this.getOffsetForAlignment(centerOffset, align), align] as const
case 'end':
return [this.getOffsetForAlignment(item.end + this.options.scrollPaddingEnd, align), align] as const
return [
this.getOffsetForAlignment(
item.end + this.options.scrollPaddingEnd,
align,
),
align,
] as const
default:
return [this.getOffsetForAlignment(item.start - this.options.scrollPaddingStart, align), align] as const
return [
this.getOffsetForAlignment(
item.start - this.options.scrollPaddingStart,
align,
),
align,
] as const
}
}

Expand Down

0 comments on commit bd21dd9

Please sign in to comment.