I created a contentEditable editor and I need to get the pixel position of the cursor so that I can position its menu. (As the user enters a special line, the menu opens automatically to show a hint).
All this works for me, except that I do not know how to get the actual cursor pixel position for positioning the menu. The best I managed to do was get the current node cursor, but I still don't know where the cursor is inside this element.
β I can get the position of this div easily enough <div>I am typing a message |</div> β But I need the position of the cursor here
Change I can confirm that using Range, as in the text box , also works for ContentEditable.
source share