d4rkr00t / prosemirror-dev-tools

Developer Tools for ProseMirror
317 stars 37 forks source link

fix: bind dispatchTransaction #97

Closed optimistiks closed 5 years ago

optimistiks commented 5 years ago

Bind dispatchTransaction so it is always called with the view instance as this.

Prosemirror always calls dispatchTransaction with the current view instance as this. https://github.com/ProseMirror/prosemirror-view/blob/master/src/index.js#L348 It's not happening when using dev-tools due to monkey-patching the dispatchTransaction. This PR fixes it.