Fixed #882 - Dialog component scrollbar shift

This commit is contained in:
mertsincan 2023-09-25 10:30:34 +01:00
parent e0fe133189
commit e204de32f4
2 changed files with 3 additions and 0 deletions

View file

@ -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) {