diff --git a/README.md b/README.md index b5c68ac88..45818d7f1 100644 --- a/README.md +++ b/README.md @@ -87,8 +87,9 @@ export default { | `registerPlugin` | `plugin` | Register a Prosemirror plugin. | | `getJSON` | – | Get the current content as JSON. | | `getHTML` | – | Get the current content as HTML. | -| `focus` | — | Focus the editor | -| `destroy` | – | Destroys the editor. | +| `focus` | – | Focus the editor. | +| `blur` | – | Blur the editor. | +| `destroy` | – | Destroy the editor. | ## Components diff --git a/packages/tiptap/src/Editor.js b/packages/tiptap/src/Editor.js index b43156581..3b6b3ca48 100644 --- a/packages/tiptap/src/Editor.js +++ b/packages/tiptap/src/Editor.js @@ -298,6 +298,10 @@ export default class Editor { this.view.focus() } + blur() { + this.view.dom.blur() + } + getHTML() { const div = document.createElement('div') const fragment = DOMSerializer