BlockScroll feature added

pull/3465/head
Bahadır Sofuoğlu 2023-01-03 17:35:38 +03:00
parent 80e3981e92
commit 2302dc4206
1 changed files with 7 additions and 1 deletions

View File

@ -64,7 +64,7 @@ export default {
},
blockScroll: {
type: Boolean,
default: false
default: true
}
},
maskClickListener: null,
@ -95,7 +95,9 @@ export default {
methods: {
hide() {
this.$emit('update:visible', false);
this.outsideClickListener && this.unbindOutsideClickListener();
this.blockScroll && DomHandler.removeClass(document.body, 'p-overflow-hidden');
},
onEnter() {
this.$emit('show');
@ -120,6 +122,10 @@ export default {
},
onAfterEnter() {
this.bindOutsideClickListener();
if (this.blockScroll) {
DomHandler.addClass(document.body, 'p-overflow-hidden');
}
},
focus() {
const findFocusableElement = (container) => {