Browse Source

fix(BI-134501): 主线不找最外层body

research/test
windy 1 year ago
parent
commit
b63c81b25b
  1. 20
      packages/fineui/src/core/utils/dom.js

20
packages/fineui/src/core/utils/dom.js

@ -794,13 +794,15 @@ export function getPositionRelativeContainingBlockRect(element) {
*/
export function getOuterBody() {
// 默认挂在body上的都找最外层的body
let parentWindow = window;
let body = document.body;
try {
while (parentWindow.parent !== parentWindow) {
parentWindow = parentWindow.parent;
}
body = parentWindow.document.body;
} catch (e) {}
return body;
// let parentWindow = window;
// let body = document.body;
// try {
// while (parentWindow.parent !== parentWindow) {
// parentWindow = parentWindow.parent;
// }
// body = parentWindow.document.body;
// } catch (e) {}
// return body;
return document.body;
}

Loading…
Cancel
Save