Different getBoundingClientRect() values on prod and dev #13927
-
Bug reportDescribe the bugIn development mode, the method To ReproducecomponentDidMount() {
const element = document.getElementById("bouding");
console.log(element.getBoundingClientRect());
}
render() {
return <h1 className="bouding">bouding element</h1>
} Expected behaviorIn development mode I get these data {
bottom: 430.5,
height: 5,
left: 104,
right: 204,
top: 425.5,
width: 100,
x: 104,
y: 425.5
} While in production it's totally different, and wrong... {
bottom: 2127.683349609375,
height: 16,
left: 8,
right: 8,
top: 2111.683349609375,
width: 0,
x: 8,
y: 2111.683349609375
} System information
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
Just a question. I've created two issues, this one and another one. Why were they placed in "discussion" and didn't stay in the issues tab ? Thanks 😄 |
Beta Was this translation helpful? Give feedback.
-
@mlbonniec we were experiencing a similar issue, and it had to do with our fonts loading after our element dimensions were calculated, which affected the element dimensions. hope it helps! |
Beta Was this translation helpful? Give feedback.
@mlbonniec we were experiencing a similar issue, and it had to do with our fonts loading after our element dimensions were calculated, which affected the element dimensions. hope it helps!