mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-20 06:01:24 +02:00
Fix cloneFragment to work with multiple Editor instances (#1728)
This commit is contained in:
committed by
Ian Storm Taylor
parent
25aa1ec952
commit
4346ad0e3f
@@ -96,7 +96,7 @@ function cloneFragment(event, value, fragment = value.fragment) {
|
||||
attach.setAttribute('data-slate-fragment', encoded)
|
||||
|
||||
// Add the phony content to the DOM, and select it, so it will be copied.
|
||||
const editor = window.document.querySelector('[data-slate-editor]')
|
||||
const editor = event.target.closest('[data-slate-editor]')
|
||||
const div = window.document.createElement('div')
|
||||
div.setAttribute('contenteditable', true)
|
||||
div.style.position = 'absolute'
|
||||
|
Reference in New Issue
Block a user