I have HTML <input type="text"> or <textarea> with random existing text, say [12345678] or [12345
67890]
There is an occasional mouse click in this text. I need to convert the 2D coordinates of mouse clicks to 1D character-based text coordinates in order to correctly position the JS carriage. Obviously, the browser has a function that does this conversion internally; it would be great to call it. The input has a standard font of variable width and can be at any zoom level. The browser is limited to FireFox. We have jQuery and JCursor.
Background: the input field is dynamically generated inside deeply nested blocks, each of which has a gross overload. The combination of legacy code with the latest FF implementation somehow steals reproduction / focus between time and time delays when it gets into the default action for the default browser, which doesn't happen. I need to adjust the carriage.
source share