Skip to content

Commit

Permalink
Merge pull request locomotivemtl#347 from xavierfoucrier/fix/mouseup-…
Browse files Browse the repository at this point in the history
…scrolling-class

Fix scrolling class applied on `mouseup` event
  • Loading branch information
devenini authored Oct 21, 2021
2 parents e02def9 + aa4d4d9 commit e12c470
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/scripts/Native.js
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ export default class extends Core {

window.scrollTo({
top: offset,
behavior: 'smooth'
behavior: options.duration === 0 ? 'auto' : 'smooth'
});
}

Expand Down
6 changes: 5 additions & 1 deletion src/scripts/Smooth.js
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,11 @@ export default class extends Core {

releaseScrollBar(e) {
this.isDraggingScrollbar = false;
this.html.classList.add(this.scrollingClass);

if (this.isScrolling) {
this.html.classList.add(this.scrollingClass);
}

this.html.classList.remove(this.draggingClass);
}

Expand Down

0 comments on commit e12c470

Please sign in to comment.