react-container-dimensions icon indicating copy to clipboard operation
react-container-dimensions copied to clipboard

getBoundingClientRect takes `transform: scale` into account

Open okonet opened this issue 8 years ago • 0 comments

If some parent element has a transform: scale applied then getBoundingClientRect will take it into account and return actual sizes. This might be undesirable in some situations so probably offsetWidth and offsetHeight are better options but they won't work with SVG elements AFAIK.

okonet avatar Jul 13 '16 09:07 okonet