Skip to content

Commit

Permalink
fix: drag and drop in iframes (#4506) (#4636)
Browse files Browse the repository at this point in the history
* fix: drag and drop in iframes (#4506)

* Create changeset

* Update iframe-drop-actions.md
  • Loading branch information
cmmartin authored Oct 28, 2021
1 parent 35abac1 commit 9e8d5e2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/iframe-drop-actions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'slate-react': patch
---

Fixes drop actions in editors rendered in iFrames.
2 changes: 1 addition & 1 deletion packages/slate-react/src/plugin/react-editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ export const ReactEditor = {

// Else resolve a range from the caret position where the drop occured.
let domRange
const { document } = window
const { document } = ReactEditor.getWindow(editor)

// COMPAT: In Firefox, `caretRangeFromPoint` doesn't exist. (2016/07/25)
if (document.caretRangeFromPoint) {
Expand Down

0 comments on commit 9e8d5e2

Please sign in to comment.