Go to file
Ryan McCarvill c6ed77a0fc 🐛 fix editor cursor scrolling (#672)
no issue

When calculating if the editor should scroll to keep the cursor on screen upon selection change the editor would appear to scroll to random locations.

The issue stemmed from the fact that the getPositionFromRange method took into account the scroll offset when figuring out the pixel position of a range. So, if the editor was vertically scrolled the scrollTop was added to the cursor position which the editor would assume meant that the cursor was offscreen when it wasn't.

This fix creates a new method getPositionOnScreenFromRange which finds the position of an element on screen and ignores the scroll offset.
2017-04-25 11:29:45 +01:00
ghost/admin 🐛 fix editor cursor scrolling (#672) 2017-04-25 11:29:45 +01:00