Skip to content

Commit

Permalink
fix(VSlideGroup): prevent thrashing DOM when available space < width
Browse files Browse the repository at this point in the history
fixes #11122
  • Loading branch information
KaelWD committed Jul 28, 2020
1 parent 2620930 commit 0f3f4b5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/vuetify/src/components/VSlideGroup/VSlideGroup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -355,9 +355,9 @@ export const BaseSlideGroup = mixins<options &
const itemOffset = clientWidth + offsetLeft
const additionalOffset = clientWidth * 0.4

if (offsetLeft < currentScrollOffset) {
if (offsetLeft <= currentScrollOffset) {
currentScrollOffset = Math.max(offsetLeft - additionalOffset, 0)
} else if (totalWidth < itemOffset) {
} else if (totalWidth <= itemOffset) {
currentScrollOffset = Math.min(currentScrollOffset - (totalWidth - itemOffset - additionalOffset), widths.content - widths.wrapper)
}

Expand Down

0 comments on commit 0f3f4b5

Please sign in to comment.