Skip to content

Commit

Permalink
Fixed #882 - Dialog component scrollbar shift
Browse files Browse the repository at this point in the history
  • Loading branch information
mertsincan committed Sep 25, 2023
1 parent e0fe133 commit e204de3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions components/lib/base/Base.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const styles = `
.p-overflow-hidden {
overflow: hidden;
padding-right: var(--scrollbar-width);
}
`;

Expand Down
2 changes: 2 additions & 0 deletions components/lib/dialog/Dialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -213,11 +213,13 @@ export default {
enableDocumentSettings() {
if (this.modal || (!this.modal && this.blockScroll) || (this.maximizable && this.maximized)) {
DomHandler.addClass(document.body, 'p-overflow-hidden');
document.body.style.setProperty('--scrollbar-width', DomHandler.calculateScrollbarWidth() + 'px');
}
},
unbindDocumentState() {
if (this.modal || (!this.modal && this.blockScroll) || (this.maximizable && this.maximized)) {
DomHandler.removeClass(document.body, 'p-overflow-hidden');
document.body.style.removeProperty('--scrollbar-width');
}
},
onKeyDown(event) {
Expand Down

0 comments on commit e204de3

Please sign in to comment.