prosemirror-view
Advanced tools
Comparing version 1.6.1 to 1.6.2
@@ -0,1 +1,7 @@ | ||
## 1.6.2 (2018-10-08) | ||
### Bug fixes | ||
Fixes an issue where event handlers were leaked when destroying an editor | ||
## 1.6.1 (2018-10-01) | ||
@@ -2,0 +8,0 @@ |
{ | ||
"name": "prosemirror-view", | ||
"version": "1.6.1", | ||
"version": "1.6.2", | ||
"description": "ProseMirror's view component", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
# prosemirror-view | ||
[ [**WEBSITE**](http://prosemirror.net) | [**ISSUES**](https://github.com/prosemirror/prosemirror/issues) | [**FORUM**](https://discuss.prosemirror.net) | [**GITTER**](https://gitter.im/ProseMirror/prosemirror) | [**CHANGELOG**](https://github.com/ProseMirror/prosemirror/blob/master/CHANGELOG.md) ] | ||
[ [**WEBSITE**](http://prosemirror.net) | [**ISSUES**](https://github.com/prosemirror/prosemirror/issues) | [**FORUM**](https://discuss.prosemirror.net) | [**GITTER**](https://gitter.im/ProseMirror/prosemirror) | [**CHANGELOG**](https://github.com/ProseMirror/prosemirror-view/blob/master/CHANGELOG.md) ] | ||
@@ -5,0 +5,0 @@ This is a [core module](http://prosemirror.net/docs/ref/#view) of [ProseMirror](http://prosemirror.net). |
@@ -18,5 +18,8 @@ import {TextSelection, NodeSelection} from "prosemirror-state" | ||
this.poller = poller(this) | ||
this.focusFunc = (() => this.poller.start(hasFocusAndSelection(this.view))).bind(this) | ||
this.blurFunc = this.poller.stop | ||
view.dom.addEventListener("focus", () => this.poller.start(hasFocusAndSelection(this.view))) | ||
view.dom.addEventListener("blur", () => this.poller.stop()) | ||
view.dom.addEventListener("focus", this.focusFunc) | ||
view.dom.addEventListener("blur", this.blurFunc) | ||
@@ -26,3 +29,7 @@ if (!view.editable) this.poller.start(false) | ||
destroy() { this.poller.stop() } | ||
destroy() { | ||
this.view.dom.removeEventListener("focus", this.focusFunc) | ||
this.view.dom.removeEventListener("blur", this.blurFunc) | ||
this.poller.stop() | ||
} | ||
@@ -29,0 +36,0 @@ poll(origin) { this.poller.poll(origin) } |
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
740645
8354