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/dist/index.js CHANGED
@@ -381,7 +381,10 @@ function posAtCoords(view, coords) {
381
381
  if (!elt) { return null }
382
382
  }
383
383
  // Safari's caretRangeFromPoint returns nonsense when on a draggable element
384
- if (result.safari && elt.draggable) { node = offset = null; }
384
+ if (result.safari) {
385
+ for (var p = elt; node && p; p = parentNode(p))
386
+ { if (p.draggable) { node = offset = null; } }
387
+ }
385
388
  elt = targetKludge(elt, coords);
386
389
  if (node) {
387
390
  if (result.gecko && node.nodeType == 1) {
@@ -2723,7 +2726,7 @@ function readDOMChange(view, from, to, typeOver, addedNodes) {
2723
2726
  // Edge just doesn't move the cursor forward when you start typing
2724
2727
  // in an empty block or between br nodes.
2725
2728
  if (sel$2 && !(result.chrome && result.android && view.composing && sel$2.empty &&
2726
- (change.from != change.toB || view.lastAndroidDelete < Date.now() - 100) &&
2729
+ (change.start != change.endB || view.lastAndroidDelete < Date.now() - 100) &&
2727
2730
  (sel$2.head == chFrom || sel$2.head == tr.mapping.map(chTo) - 1) ||
2728
2731
  result.ie && sel$2.empty && sel$2.head == chFrom))
2729
2732
  { tr.setSelection(sel$2); }
@@ -3574,8 +3577,10 @@ var MouseDown = function MouseDown(view, pos, event, flushed) {
3574
3577
  var targetDesc = target ? view.docView.nearestDesc(target, true) : null;
3575
3578
  this.target = targetDesc ? targetDesc.dom : null;
3576
3579
 
3580
+ var ref = view.state;
3581
+ var selection = ref.selection;
3577
3582
  if (targetNode.type.spec.draggable && targetNode.type.spec.selectable !== false ||
3578
- view.state.selection instanceof prosemirrorState.NodeSelection && targetPos == view.state.selection.from)
3583
+ selection instanceof prosemirrorState.NodeSelection && selection.from <= targetPos && selection.to > targetPos)
3579
3584
  { this.mightDrag = {node: targetNode,
3580
3585
  pos: targetPos,
3581
3586
  addAttr: this.target && !this.target.draggable,