Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correction to editor paste event #72

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/content/editor/api/events.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ The editor fires a few different events that you can hook into. Let’s have a l
| `focus` | Triggered when the editor gains focus. |
| `blur` | Fired when the editor loses focus. |
| `destroy` | Occurs when the editor instance is being destroyed. |
| `onPaste` | Fired when content is pasted into the editor. |
| `paste` | Fired when content is pasted into the editor. |
| `onDrop` | Fired when content is dropped into the editor. |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| `onDrop` | Fired when content is dropped into the editor. |
| `drop` | Fired when content is dropped into the editor. |

| `contentError` | The content does not match the schema. [Read more here](/editor/core-concepts/schema#invalid-schema-handling) |

Expand Down Expand Up @@ -109,7 +109,7 @@ editor.on('destroy', () => {
// The editor is being destroyed.
})

editor.on('onPaste', (event: ClipboardEvent, slice: Slice) => {
editor.on('paste', ({ event: ClipboardEvent, slice: Slice, editor: Editor }) => {
// The editor is being pasted into.
})

Expand Down