Browse Source

Pull request #3655: fix(BI-134501): 主线不找最外层body

Merge in VISUAL/fineui from ~WINDY/fui:master to master

* commit '22cad7d0ec48b94605f3ae65d9ac40505c6d5925':
  fix(BI-134501): 主线不找最外层body
research/test
windy-许昊 1 year ago
parent
commit
a4a07be62b
  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() { export function getOuterBody() {
// 默认挂在body上的都找最外层的body // 默认挂在body上的都找最外层的body
let parentWindow = window; // let parentWindow = window;
let body = document.body; // let body = document.body;
try { // try {
while (parentWindow.parent !== parentWindow) { // while (parentWindow.parent !== parentWindow) {
parentWindow = parentWindow.parent; // parentWindow = parentWindow.parent;
} // }
body = parentWindow.document.body; // body = parentWindow.document.body;
} catch (e) {} // } catch (e) {}
return body; // return body;
return document.body;
} }

Loading…
Cancel
Save