I'm trying to get the coordinates of a click event in chrome. The event is generated using onClick
handler of a ReactComponent like so:
<img
onClick={(e) => { console.log('e:', e.clientX, window.scrollX, "pageX", e.pageX);}}
</img>
The resulting value:
Clearly does not match the value as measured by a ruler. This is also manifested when I try and add a div at the position of the click. It doesn't appear at the correct position, but rather at an offset.
Has anybody encountered a similar situation?