Skip to content

Commit b307451

Browse files
authored
Merge pull request #1162 from MatheusRich/patch-1
Document the `trix-before-paste` event
2 parents fee2e50 + b5d39c2 commit b307451

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -636,6 +636,8 @@ The `<trix-editor>` element emits several events which you can use to observe an
636636
637637
* `trix-before-render` fires before the editor’s new contents are rendered. You can override the function used to render the content through the `render` property on the event. The `render` function expects two positional arguments: the `<trix-editor>` element that will render and a [DocumentFragment](https://developer.mozilla.org/en-US/docs/Web/API/DocumentFragment) instance that contains the new content. Read [HTML Rendering](#html-rendering) to learn more.
638638
639+
* `trix-before-paste` fires just before text is pasted into the editor. You can use this to modify the content being pasted or prevent the paste event from happening at all. The `paste` property on the event contains the pasted `string` or `html`, and the `range` of the inserted text.
640+
639641
* `trix-paste` fires whenever text is pasted into the editor. The `paste` property on the event contains the pasted `string` or `html`, and the `range` of the inserted text.
640642
641643
* `trix-selection-change` fires any time the selected range changes in the editor.

0 commit comments

Comments
 (0)