I use Range to control the selected text. I would like to calculate the height with which someone began to choose the text where they finished.
I tried the range to the beginning and end of the selected range, and I can accurately calculate the shape of the height, but it changes the DOM and does not allow me to do some other range manipulations, for example, highlighting previously selected text.
I also tried to collect the position of the mosedown and mosueup positions, but I need the exact height from the top of the text selected at the bottom of the text where the selection was released, and this is not always the case.
So, I was wondering if there is a way to calculate the height of the text without changing the DOM?
source share