mirror of
https://github.com/zoriya/react-native-web.git
synced 2025-12-06 06:36:13 +00:00
[fix] use getBoundingClientRect instead of getRect for measureInWindow
Fix #2589 Close #2613
This commit is contained in:
committed by
Nicolas Gallagher
parent
8f55ed0f60
commit
e44bcf4e81
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user