prosemirror-view
Advanced tools
Comparing version 1.23.6 to 1.23.7
{ | ||
"name": "prosemirror-view", | ||
"version": "1.23.6", | ||
"version": "1.23.7", | ||
"description": "ProseMirror's view component", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -42,3 +42,4 @@ import browser from "./browser" | ||
let parent = node.parentNode | ||
if (parent.nodeType != 1 || hasBlockDesc(node) || atomElements.test(node.nodeName) || node.contentEditable == "false") | ||
if (!parent || parent.nodeType != 1 || hasBlockDesc(node) || atomElements.test(node.nodeName) || | ||
node.contentEditable == "false") | ||
return false | ||
@@ -45,0 +46,0 @@ off = domIndex(node) + (dir < 0 ? 0 : 1) |
@@ -177,3 +177,3 @@ import browser from "./browser" | ||
this.handleDOMChange(from, to, typeOver, added) | ||
if (this.view.docView.dirty) this.view.updateState(this.view.state) | ||
if (this.view.docView && this.view.docView.dirty) this.view.updateState(this.view.state) | ||
else if (!this.currentSelection.eq(sel)) selectionToDOM(this.view) | ||
@@ -180,0 +180,0 @@ this.currentSelection.set(sel) |
@@ -605,3 +605,6 @@ import {NodeSelection} from "prosemirror-state" | ||
// [`DOMSerializer.fromSchema`](#model.DOMSerializer^fromSchema) | ||
// will be used. | ||
// will be used. This object will only have its | ||
// [`serializeFragment`](#model.DOMSerializer.serializeFragment) | ||
// method called, and you may provide an alternative object type | ||
// implementing a compatible method. | ||
// | ||
@@ -608,0 +611,0 @@ // clipboardTextSerializer:: ?(Slice) → string |
@@ -488,3 +488,3 @@ import {Selection, NodeSelection, TextSelection} from "prosemirror-state" | ||
clearComposition(view) | ||
if (forceUpdate || view.docView.dirty) { | ||
if (forceUpdate || view.docView && view.docView.dirty) { | ||
let sel = selectionFromDOM(view) | ||
@@ -491,0 +491,0 @@ if (sel && !sel.eq(view.state.selection)) view.dispatch(view.state.tr.setSelection(sel)) |
Sorry, the diff of this file is too big to display
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
1602542
14895