Refactor #3965 - Update for OverlayPanel

pull/4041/head^2
Tuğçe Küçükoğlu 2023-06-09 12:20:59 +03:00
parent 8467dd2a0d
commit 1625d6e4f5
2 changed files with 3 additions and 5 deletions

View File

@ -4,10 +4,7 @@ import { useStyle } from 'primevue/usestyle';
const styles = ` const styles = `
.p-overlaypanel { .p-overlaypanel {
position: absolute;
margin-top: 10px; margin-top: 10px;
top: 0;
left: 0;
} }
.p-overlaypanel-flipped { .p-overlaypanel-flipped {
@ -87,7 +84,7 @@ const classes = {
], ],
content: 'p-overlaypanel-content', content: 'p-overlaypanel-content',
closeButton: 'p-overlaypanel-close p-link', closeButton: 'p-overlaypanel-close p-link',
closeIcon: ({ props }) => ['p-overlaypanel-close-icon ', props.closeIcon] closeIcon: 'p-overlaypanel-close-icon'
}; };
const { load: loadStyle } = useStyle(styles, { id: 'primevue_overlaypanel_style', manual: true }); const { load: loadStyle } = useStyle(styles, { id: 'primevue_overlaypanel_style', manual: true });

View File

@ -7,7 +7,7 @@
</div> </div>
<button v-if="showCloseIcon" v-ripple :class="cx('closeButton')" :aria-label="closeAriaLabel" type="button" autofocus @click="hide" @keydown="onButtonKeydown" v-bind="ptm('closeButton')"> <button v-if="showCloseIcon" v-ripple :class="cx('closeButton')" :aria-label="closeAriaLabel" type="button" autofocus @click="hide" @keydown="onButtonKeydown" v-bind="ptm('closeButton')">
<slot name="closeicon"> <slot name="closeicon">
<component :is="closeIcon ? 'span' : 'TimesIcon'" :class="cx('closeIcon')" v-bind="ptm('closeIcon')"></component> <component :is="closeIcon ? 'span' : 'TimesIcon'" :class="[cx('closeIcon'), closeIcon]" v-bind="ptm('closeIcon')"></component>
</slot> </slot>
</button> </button>
</div> </div>
@ -104,6 +104,7 @@ export default {
}, },
onEnter(el) { onEnter(el) {
this.container.setAttribute(this.attributeSelector, ''); this.container.setAttribute(this.attributeSelector, '');
DomHandler.addStyles(el, { position: 'absolute', top: '0', left: '0' });
this.alignOverlay(); this.alignOverlay();
if (this.dismissable) { if (this.dismissable) {