Skip to content

Commit

Permalink
Fix style reset in destroy method
Browse files Browse the repository at this point in the history
- Explicitly remove individual style properties instead of using applyStyle
- Remove position, width, box-sizing, top, and left styles when destroying PrettyScroll instance
  • Loading branch information
uidev1116 committed Feb 27, 2025
1 parent f4bbe51 commit 12be5c0
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/core/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ export default class PrettyScroll {
if (this.beforeElement && this.beforeElement.parentElement) {
this.beforeElement.parentElement.removeChild(this.beforeElement);
}
this.applyStyle({
position: 'static',
width: this.targetWidth,
boxSizing: this.targetBoxSizing,
});
this.targetElement.style.removeProperty('position');
this.targetElement.style.removeProperty('width');
this.targetElement.style.removeProperty('box-sizing');
this.targetElement.style.removeProperty('top');
this.targetElement.style.removeProperty('left');
}

onScroll() {
Expand Down

0 comments on commit 12be5c0

Please sign in to comment.