prosemirror-view 1.18.6 → 1.18.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/dist/index.es.js +8 -3
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +8 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/domchange.js +1 -1
- package/src/domcoords.js +4 -1
- package/src/input.js +2 -1
package/package.json
CHANGED
package/src/domchange.js
CHANGED
|
@@ -242,7 +242,7 @@ export function readDOMChange(view, from, to, typeOver, addedNodes) {
|
|
|
242
242
|
// Edge just doesn't move the cursor forward when you start typing
|
|
243
243
|
// in an empty block or between br nodes.
|
|
244
244
|
if (sel && !(browser.chrome && browser.android && view.composing && sel.empty &&
|
|
245
|
-
(change.
|
|
245
|
+
(change.start != change.endB || view.lastAndroidDelete < Date.now() - 100) &&
|
|
246
246
|
(sel.head == chFrom || sel.head == tr.mapping.map(chTo) - 1) ||
|
|
247
247
|
browser.ie && sel.empty && sel.head == chFrom))
|
|
248
248
|
tr.setSelection(sel)
|
package/src/domcoords.js
CHANGED
|
@@ -250,7 +250,10 @@ export function posAtCoords(view, coords) {
|
|
|
250
250
|
if (!elt) return null
|
|
251
251
|
}
|
|
252
252
|
// Safari's caretRangeFromPoint returns nonsense when on a draggable element
|
|
253
|
-
if (browser.safari
|
|
253
|
+
if (browser.safari) {
|
|
254
|
+
for (let p = elt; node && p; p = parentNode(p))
|
|
255
|
+
if (p.draggable) node = offset = null
|
|
256
|
+
}
|
|
254
257
|
elt = targetKludge(elt, coords)
|
|
255
258
|
if (node) {
|
|
256
259
|
if (browser.gecko && node.nodeType == 1) {
|
package/src/input.js
CHANGED
|
@@ -302,8 +302,9 @@ class MouseDown {
|
|
|
302
302
|
const targetDesc = target ? view.docView.nearestDesc(target, true) : null
|
|
303
303
|
this.target = targetDesc ? targetDesc.dom : null
|
|
304
304
|
|
|
305
|
+
let {selection} = view.state
|
|
305
306
|
if (targetNode.type.spec.draggable && targetNode.type.spec.selectable !== false ||
|
|
306
|
-
|
|
307
|
+
selection instanceof NodeSelection && selection.from <= targetPos && selection.to > targetPos)
|
|
307
308
|
this.mightDrag = {node: targetNode,
|
|
308
309
|
pos: targetPos,
|
|
309
310
|
addAttr: this.target && !this.target.draggable,
|