Skip to content

Commit 9864196

Browse files
committed
fix cursor issue in Firefox
closes #111 closes #115
1 parent d7a1126 commit 9864196

File tree

1 file changed

+0
-9
lines changed

1 file changed

+0
-9
lines changed

codejar.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -110,15 +110,6 @@ export function CodeJar(editor: HTMLElement, highlight: (e: HTMLElement, pos?: P
110110
let {anchorNode, anchorOffset, focusNode, focusOffset} = s
111111
if (!anchorNode || !focusNode) throw 'error1'
112112

113-
// If the anchor and focus are the editor element, return either a full
114-
// highlight or a start/end cursor position depending on the selection
115-
if (anchorNode === editor && focusNode === editor) {
116-
pos.start = (anchorOffset > 0 && editor.textContent) ? editor.textContent.length : 0
117-
pos.end = (focusOffset > 0 && editor.textContent) ? editor.textContent.length : 0
118-
pos.dir = (focusOffset >= anchorOffset) ? '->' : '<-'
119-
return pos
120-
}
121-
122113
// Selection anchor and focus are expected to be text nodes,
123114
// so normalize them.
124115
if (anchorNode.nodeType === Node.ELEMENT_NODE) {

0 commit comments

Comments
 (0)