editor: Missing names of exercises on a canvas
[fnpeditor.git] / src / editor / modules / documentCanvas / canvas / selection.js
index 4de392b..e072050 100644 (file)
@@ -129,7 +129,7 @@ return {
                 params = {
                     type: 'caret',
                     element: element,
                 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);
                 };
             } else if(isText(nativeSelection.focusNode) && isText(nativeSelection.anchorNode)) {
                 anchorElement = canvas.getDocumentElement(nativeSelection.anchorNode);