added workaround in _getCursorIndexForRelativePosition