mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: ensures rects is present before using it (#11930)
I don't have a clear reproduction ATM, but I imagine that in fast tests element can get destroyed before we get to use it.
This commit is contained in:
@@ -883,7 +883,10 @@ export default Component.extend(
|
||||
wrapper.style.height = `${height}px`;
|
||||
if (placementStrategy === "fixed") {
|
||||
const rects = this.element.getClientRects()[0];
|
||||
|
||||
if (rects) {
|
||||
const bodyRects = body && body.getClientRects()[0];
|
||||
|
||||
wrapper.style.position = "fixed";
|
||||
wrapper.style.left = `${rects.left}px`;
|
||||
if (topPlacement && bodyRects) {
|
||||
@@ -896,6 +899,7 @@ export default Component.extend(
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user