Sizing through offsetWidth and offsetHeight results in rounded values instead of actual values, which leads to errors in Firefox. [Example](https://codesandbox.io/s/youthful-euler-45vf6), change the width of the results window to see the problem Screenshots: - [with error](https://drive.google.com/file/d/11XRUgvY2g4Lq7e0oz4LkJBkhUZiaSjuQ/view) - [without error](https://drive.google.com/file/d/1CYlw8fJ9weGVV5TYE0e0yz6ptyfm9_Oc/view?usp=sharing) Links: - [MDN: getBoundingClientRect](https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect) - [MDN: offsetWidth](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/offsetWidth)