Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix the unexpected joggle state when dialog component non-fixed #6161

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions packages/primevue/src/dialog/Dialog.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<Portal :appendTo="appendTo">
<div v-if="containerVisible" :ref="maskRef" :class="cx('mask')" :style="sx('mask', true, { position, modal })" @mousedown="onMaskMouseDown" @mouseup="onMaskMouseUp" v-bind="ptm('mask')">
<transition name="p-dialog" @before-enter="onBeforeEnter" @enter="onEnter" @before-leave="onBeforeLeave" @leave="onLeave" @after-leave="onAfterLeave" appear v-bind="ptm('transition')">
<transition name="p-dialog" @before-enter="onBeforeEnter" @enter="onEnter" @after-enter="onAfterEnter" @before-leave="onBeforeLeave" @leave="onLeave" @after-leave="onAfterLeave" appear v-bind="ptm('transition')">
<div v-if="visible" :ref="containerRef" v-focustrap="{ disabled: !modal }" :class="cx('root')" :style="sx('root')" role="dialog" :aria-labelledby="ariaLabelledById" :aria-modal="modal" v-bind="ptmi('root')">
<slot v-if="$slots.container" name="container" :closeCallback="close" :maximizeCallback="(event) => maximize(event)"></slot>
<template v-else>
Expand Down Expand Up @@ -149,14 +149,16 @@ export default {
onEnter() {
this.$emit('show');
this.target = document.activeElement;
this.focus();
this.enableDocumentSettings();
this.bindGlobalListeners();

if (this.autoZIndex) {
ZIndex.set('modal', this.mask, this.baseZIndex + this.$primevue.config.zIndex.modal);
}
},
onAfterEnter() {
this.focus();
},
onBeforeLeave() {
if (this.modal) {
!this.isUnstyled && addClass(this.mask, 'p-overlay-mask-leave');
Expand Down
Loading