Skip to content

Commit

Permalink
inline-toolbar: Try getting the relative parent window object first, …
Browse files Browse the repository at this point in the history
…for supporting iframe implementations (draft-js-plugins#1439)
  • Loading branch information
nadelalon authored Sep 9, 2020
1 parent 8a6ca48 commit 9d9b01a
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ export default class Toolbar extends React.Component {
}
const editorRootRect = editorRoot.getBoundingClientRect();

const selectionRect = getVisibleSelectionRect(window);
const parentWindow = editorRoot.ownerDocument && editorRoot.ownerDocument.defaultView;
const selectionRect = getVisibleSelectionRect(parentWindow || window);
if (!selectionRect) return;

// The toolbar shouldn't be positioned directly on top of the selected text,
Expand Down

0 comments on commit 9d9b01a

Please sign in to comment.