prosemirror-view
Advanced tools
Comparing version 1.4.2 to 1.4.3
@@ -0,1 +1,7 @@ | ||
## 1.4.3 (2018-08-12) | ||
### Bug fixes | ||
Fix an issue where the editor got stuck believing shift was down (and hence pasting as plain text) when it was unfocused with shift held down. | ||
## 1.4.2 (2018-08-03) | ||
@@ -2,0 +8,0 @@ |
{ | ||
"name": "prosemirror-view", | ||
"version": "1.4.2", | ||
"version": "1.4.3", | ||
"description": "ProseMirror's view component", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -121,5 +121,11 @@ import {Fragment, DOMParser} from "prosemirror-model" | ||
} | ||
// Work around issue in Chrome where backspacing sometimes replaces the deleted content with a random BR node | ||
if (browser.chrome && view.lastKeyCode === 8 && toOffset > fromOffset && | ||
parent.childNodes[toOffset - 1].nodeType == "BR" && !parent.childNodes[toOffset - 1].pmViewDesc) toOffset-- | ||
// Work around issue in Chrome where backspacing sometimes replaces | ||
// the deleted content with a random BR node (issues #799, #831) | ||
if (browser.chrome && view.lastKeyCode === 8) { | ||
for (let off = toOffset; off > fromOffset; off--) { | ||
let node = parent.childNodes[off - 1], desc = node.pmViewDesc | ||
if (node.nodeType == "BR" && !desc) { toOffset = off; break } | ||
if (!desc || desc.size) break | ||
} | ||
} | ||
let startDoc = oldState.doc | ||
@@ -126,0 +132,0 @@ let parser = view.someProp("domParser") || DOMParser.fromSchema(view.state.schema) |
@@ -74,3 +74,3 @@ import {Selection, NodeSelection, TextSelection} from "prosemirror-state" | ||
editHandlers.keydown = (view, event) => { | ||
if (event.keyCode == 16) view.shiftKey = true | ||
view.shiftKey = event.keyCode == 16 || event.shiftKey | ||
if (view.inDOMChange) { | ||
@@ -223,2 +223,3 @@ if (view.inDOMChange.composing) return | ||
handlers.mousedown = (view, event) => { | ||
view.shiftKey = event.shiftKey | ||
let flushed = forceDOMFlush(view) | ||
@@ -225,0 +226,0 @@ let now = Date.now(), type |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
733766
8310