add original event to focus and blur event
This commit is contained in:
@@ -72,8 +72,8 @@ useBuiltInExtensions
|
||||
| `extensions` | `Array` | `[]` | A list of extensions used, by the editor. This can be `Nodes`, `Marks` or `Plugins`. |
|
||||
| `useBuiltInExtensions` | `Boolean` | `true` | By default tiptap adds a `Doc`, `Paragraph` and `Text` node to the Prosemirror schema. |
|
||||
| `onInit` | `Function` | `undefined` | This will return an Object with the current `state` and `view` of Prosemirror on init. |
|
||||
| `onFocus` | `Function` | `undefined` | This will return an Object with the current `state` and `view` of Prosemirror on focus. |
|
||||
| `onBlur` | `Function` | `undefined` | This will return an Object with the current `state` and `view` of Prosemirror on blur. |
|
||||
| `onFocus` | `Function` | `undefined` | This will return an Object with the `event` and current `state` and `view` of Prosemirror on focus. |
|
||||
| `onBlur` | `Function` | `undefined` | This will return an Object with the `event` and current `state` and `view` of Prosemirror on blur. |
|
||||
| `onUpdate` | `Function` | `undefined` | This will return an Object with the current `state` of Prosemirror, a `getJSON()` and `getHTML()` function on every change. |
|
||||
|
||||
## Components
|
||||
|
||||
@@ -185,12 +185,14 @@ export default class Editor {
|
||||
|
||||
view.dom.style.whiteSpace = 'pre-wrap'
|
||||
|
||||
view.dom.addEventListener('focus', () => this.options.onFocus({
|
||||
view.dom.addEventListener('focus', event => this.options.onFocus({
|
||||
event,
|
||||
state: this.state,
|
||||
view: this.view,
|
||||
}))
|
||||
|
||||
view.dom.addEventListener('blur', () => this.options.onBlur({
|
||||
view.dom.addEventListener('blur', event => this.options.onBlur({
|
||||
event,
|
||||
state: this.state,
|
||||
view: this.view,
|
||||
}))
|
||||
|
||||
Reference in New Issue
Block a user