Closed hanford closed 2 years ago
This PR adds support for broadcasting paste events that slate-react properly receives and handles to various insertData functions.
paste
insertData
My test looks like this:
import { assertOutput, buildTestHarness } from 'slate-test-utils'; import { jsx as h } from 'slate-hyperscript'; import TextEditor from '..'; it('user copy and pastes link', async () => { const input = h('editor', [h('element', { type: 'paragraph' }, [h('text', [h('cursor')])])]); const [editor, { paste }] = await buildTestHarness(TextEditor)({ editor: input, }); await paste('foo!'); assertOutput( editor, h('editor', [h('element', { type: 'paragraph' }, [h('text', ['foo!', h('cursor')])])]), ); });
Added an optional option argument that will allow consumers to change the types value. Let me know if there is anything else!
This PR adds support for broadcasting
paste
events that slate-react properly receives and handles to variousinsertData
functions.My test looks like this: