mirror of
https://github.com/primefaces/primevue.git
synced 2025-05-09 00:42:36 +00:00
Merge branch 'master' into fix/fix-dialog-getcomputedstyle-error
This commit is contained in:
commit
2485b810f9
1040 changed files with 8378 additions and 8507 deletions
|
@ -163,7 +163,7 @@ export default {
|
|||
},
|
||||
focus() {
|
||||
const findFocusableElement = (container) => {
|
||||
return container.querySelector('[autofocus]');
|
||||
return container && container.querySelector('[autofocus]');
|
||||
};
|
||||
|
||||
let focusTarget = this.$slots.footer && findFocusableElement(this.footerContainer);
|
||||
|
@ -259,6 +259,7 @@ export default {
|
|||
if (!this.styleElement && !this.isUnstyled) {
|
||||
this.styleElement = document.createElement('style');
|
||||
this.styleElement.type = 'text/css';
|
||||
DomHandler.setAttribute(this.styleElement, 'nonce', this.$primevue?.config?.csp?.nonce);
|
||||
document.head.appendChild(this.styleElement);
|
||||
|
||||
let innerHTML = '';
|
||||
|
@ -322,7 +323,7 @@ export default {
|
|||
let leftPos = offset.left + deltaX;
|
||||
let topPos = offset.top + deltaY;
|
||||
let viewport = DomHandler.getViewport();
|
||||
let containerComputedStyle = getComputedStyle(this.container)
|
||||
let containerComputedStyle = getComputedStyle(this.container);
|
||||
let marginLeft = parseFloat(containerComputedStyle.marginLeft);
|
||||
let marginTop = parseFloat(containerComputedStyle.marginTop);
|
||||
|
||||
|
@ -331,18 +332,17 @@ export default {
|
|||
if (this.keepInViewport) {
|
||||
if (leftPos >= this.minX && leftPos + width < viewport.width) {
|
||||
this.lastPageX = event.pageX;
|
||||
this.container.style.left = (leftPos - marginLeft) + 'px';
|
||||
this.container.style.left = leftPos - marginLeft + 'px';
|
||||
}
|
||||
|
||||
if (topPos >= this.minY && topPos + height < viewport.height) {
|
||||
this.lastPageY = event.pageY;
|
||||
this.container.style.top = (topPos - marginTop) + 'px';
|
||||
}
|
||||
this.lastPageY = event.pageY;
|
||||
this.container.style.top = topPos - marginTop + 'px';
|
||||
} else {
|
||||
this.lastPageX = event.pageX;
|
||||
this.container.style.left = (leftPos - marginLeft) + 'px';
|
||||
this.container.style.left = leftPos - marginLeft + 'px';
|
||||
this.lastPageY = event.pageY;
|
||||
this.container.style.top = (topPos - marginTop) + 'px';
|
||||
this.container.style.top = topPos - marginTop + 'px';
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue