prosemirror-view
Advanced tools
Comparing version
@@ -0,1 +1,11 @@ | ||
## 1.17.4 (2021-02-04) | ||
### Bug fixes | ||
Add another kludge to work around an issue where Firefox displays the cursor in the wrong place in code blocks. | ||
Fix a bug where validation of decorations passed to `DecorationSet.add` sometimes passed the wrong offsets to the validator. | ||
Fix bad selection position in empty textblocks. Solves several issues with editing in Firefox Android. | ||
## 1.17.3 (2021-01-29) | ||
@@ -2,0 +12,0 @@ |
{ | ||
"name": "prosemirror-view", | ||
"version": "1.17.3", | ||
"version": "1.17.4", | ||
"description": "ProseMirror's view component", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -316,8 +316,6 @@ function compareObjs(a, b) { | ||
}) | ||
for (let i = 0; i < decorations.length; i++) { | ||
let deco = decorations[i] | ||
if (deco && !deco.type.valid(doc, deco)) { decorations[i] = null; childIndex = 1 } | ||
} | ||
let local = moveSpans(childIndex ? withoutNulls(decorations) : decorations, -offset) | ||
for (let i = 0; i < local.length; i++) if (!local[i].type.valid(doc, local[i])) local.splice(i--, 1) | ||
return new DecorationSet(local.length ? this.local.concat(local).sort(byPos) : this.local, | ||
@@ -324,0 +322,0 @@ children || this.children) |
@@ -270,3 +270,3 @@ import {DOMSerializer, Fragment, Mark} from "prosemirror-model" | ||
let child = i == this.children.length ? null : this.children[i] | ||
if (offset == pos && (side == 0 || !child || child.border || (side < 0 && first)) || | ||
if (offset == pos && (side == 0 || !child || !child.size || child.border || (side < 0 && first)) || | ||
child && child.domAtom && pos < offset + child.size) return { | ||
@@ -369,6 +369,11 @@ node: this.contentDOM, | ||
if ((browser.gecko || browser.safari) && anchor == head) { | ||
if (anchorDOM.node.nodeType == 3) { | ||
brKludge = anchorDOM.offset && anchorDOM.node.nodeValue[anchorDOM.offset - 1] == "\n" | ||
let {node, offset} = anchorDOM | ||
if (node.nodeType == 3) { | ||
brKludge = offset && node.nodeValue[offset - 1] == "\n" | ||
// Issue #1128 | ||
if (brKludge && offset == node.nodeValue.length && | ||
node.nextSibling && node.nextSibling.nodeName == "BR") | ||
anchorDOM = headDOM = {node: node.parentNode, offset: domIndex(node) + 1} | ||
} else { | ||
let prev = anchorDOM.node.childNodes[anchorDOM.offset - 1] | ||
let prev = node.childNodes[offset - 1] | ||
brKludge = prev && (prev.nodeName == "BR" || prev.contentEditable == "false") | ||
@@ -375,0 +380,0 @@ } |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
1500410
0.11%14020
0.06%