editor: temporary fix for invalid answer values in new exercise.order items
[fnpeditor.git] / src / editor / modules / documentCanvas / canvas / selection.js
index 4de392b..e072050 100644 (file)
@@ -129,7 +129,7 @@ return {
                 params = {
                     type: 'caret',
                     element: element,
-                    offset: element.isEmpty() ? 0 : nativeSelection.focusOffset
+                    offset: element.isEmpty() ? 0 : nativeSelection.getRangeAt(0).startOffset
                 };
             } else if(isText(nativeSelection.focusNode) && isText(nativeSelection.anchorNode)) {
                 anchorElement = canvas.getDocumentElement(nativeSelection.anchorNode);