prosemirror-view
Advanced tools
Comparing version 1.37.1 to 1.37.2
{ | ||
"name": "prosemirror-view", | ||
"version": "1.37.1", | ||
"version": "1.37.2", | ||
"description": "ProseMirror's view component", | ||
@@ -5,0 +5,0 @@ "type": "module", |
@@ -238,4 +238,6 @@ import {NodeSelection, EditorState, Plugin, PluginView, Transaction, Selection} from "prosemirror-state" | ||
scrollToSelection() { | ||
let startDOM = this.domSelectionRange().focusNode! | ||
if (this.someProp("handleScrollToSelection", f => f(this))) { | ||
let startDOM = this.domSelectionRange().focusNode | ||
if (!startDOM || !this.dom.contains(startDOM.nodeType == 1 ? startDOM : startDOM.parentNode)) { | ||
// Ignore selections outside the editor | ||
} else if (this.someProp("handleScrollToSelection", f => f(this))) { | ||
// Handled | ||
@@ -242,0 +244,0 @@ } else if (this.state.selection instanceof NodeSelection) { |
@@ -292,3 +292,8 @@ import {DOMSerializer, Fragment, Mark, Node, TagParseRule} from "prosemirror-model" | ||
if (offset == pos && end != offset) { | ||
while (!child.border && child.children.length) child = child.children[0] | ||
while (!child.border && child.children.length) { | ||
for (let i = 0; i < child.children.length; i++) { | ||
let inner = child.children[i] | ||
if (inner.size) { child = inner; break } | ||
} | ||
} | ||
return child | ||
@@ -295,0 +300,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
876372
17607