For the @mention autocomplete - found a promising solution for getting the offset position of the caret in a textarea in pixels!!

Source: https://stackoverflow.com/a/16561663

Repro: https://codepen.io/jasonleow/pen/ZEBvRjP