Skip to content

Commit de81e23

Browse files
committed
fix cursor issue in Firefox
closes #111 closes #115
1 parent f4eba92 commit de81e23

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
@@ -102,15 +102,6 @@ export function CodeJar(editor: HTMLElement, highlight: (e: HTMLElement, pos?: P
102102
let {anchorNode, anchorOffset, focusNode, focusOffset} = s
103103
if (!anchorNode || !focusNode) throw 'error1'
104104

105-
// If the anchor and focus are the editor element, return either a full
106-
// highlight or a start/end cursor position depending on the selection
107-
if (anchorNode === editor && focusNode === editor) {
108-
pos.start = (anchorOffset > 0 && editor.textContent) ? editor.textContent.length : 0
109-
pos.end = (focusOffset > 0 && editor.textContent) ? editor.textContent.length : 0
110-
pos.dir = (focusOffset >= anchorOffset) ? '->' : '<-'
111-
return pos
112-
}
113-
114105
// Selection anchor and focus are expected to be text nodes,
115106
// so normalize them.
116107
if (anchorNode.nodeType === Node.ELEMENT_NODE) {

0 commit comments

Comments
 (0)