[fix] use getBoundingClientRect instead of getRect for measureInWindow

Fix #2589
Close #2613
This commit is contained in:
s-alves10
2023-11-24 01:22:43 -06:00
committed by Nicolas Gallagher
parent 8f55ed0f60
commit e44bcf4e81

View File

@@ -7,6 +7,7 @@
* @noflow
*/
import getBoundingClientRect from '../../modules/getBoundingClientRect';
import setValueForStyles from '../../modules/setValueForStyles';
const getRect = (node) => {
@@ -82,7 +83,7 @@ const UIManager = {
measureInWindow(node, callback) {
if (node) {
setTimeout(() => {
const { height, left, top, width } = getRect(node);
const { height, left, top, width } = getBoundingClientRect(node);
callback(left, top, width, height);
}, 0);
}