Skip to content
This repository was archived by the owner on Feb 6, 2023. It is now read-only.

Take over enhancements to render Draft.js in an iframe#1938

Closed
claudiopro wants to merge 17 commits into
facebookarchive:masterfrom
claudiopro:fix-iframe-bug-commandeered
Closed

Take over enhancements to render Draft.js in an iframe#1938
claudiopro wants to merge 17 commits into
facebookarchive:masterfrom
claudiopro:fix-iframe-bug-commandeered

Conversation

@claudiopro

@claudiopro claudiopro commented Nov 19, 2018

Copy link
Copy Markdown
Contributor

Summary

Takes over and applies requested PR feedback to #1877 by @haikyuu.

Refer to original PR for context and discussion.

Test Plan

Run some manual smoke tests on the editor running in an iframe as follows:

yarn
python3 -m http.server 8080 .
open http://localhost:8080/examples/draft-0-10-0/iframe/iframe.html

@haikyuu

haikyuu commented Nov 19, 2018

Copy link
Copy Markdown
Contributor

Thanks for taking it on @claudiopro.
I've been quite busy these days. 👍

@claudiopro

Copy link
Copy Markdown
Contributor Author

Thanks to you @haikyuu for working out most of the changes! I just took it from there 😄

@claudiopro claudiopro changed the title Fix iframe bug commandeered Take over enhancements to render Draft.js in an iframe Nov 19, 2018

@facebook-github-bot facebook-github-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@claudiopro has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@facebook-github-bot facebook-github-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@claudiopro is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@odusseys

Copy link
Copy Markdown

I'm pretty sure there's is a problem with the way you destructure your event targets (eg. I'm having errors in DraftEditorDragHandler.js) to get the ownerDocument. For instance, if your target is the document itself, ownerDocument will be null, in which case you need to fallback to the target itself.

@claudiopro

Copy link
Copy Markdown
Contributor Author

Thanks for the heads up @odusseys, do you mind sharing steps to reproduce the error?

@odusseys

odusseys commented Dec 3, 2018

Copy link
Copy Markdown

Eh I'm not a hundred percent sure anymore since I fixed it on my fork and don't really have time to reproduce it; but I think I just added the drag plugin from draft-js-plugins together with the image plugin, and dragging threw an error (ownerDocument was null).
Either way this is the normal behavior (https://developer.mozilla.org/en-US/docs/Web/API/Node/ownerDocument) so null should be checked either way.

@facebook-github-bot facebook-github-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@claudiopro has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@haikyuu

haikyuu commented Feb 12, 2019

Copy link
Copy Markdown
Contributor

Hey @claudiopro what's the status on this one? anything i can do to help?

@kfrp

kfrp commented Jul 19, 2019

Copy link
Copy Markdown

Any updates on this y'all?

@kfrp

kfrp commented Jul 21, 2019

Copy link
Copy Markdown

@claudiopro @haikyuu thank you for your work on this. I was able to make it work pretty seamlessly with the latest version of Draft by replicating your commits. (Just needed to add an isHTMLBRElement check in the style of isHTMLAnchorElement etc.)

@facebook-github-bot

Copy link
Copy Markdown

@jack-arms merged this pull request in dceddf5.

mmissey pushed a commit to mmissey/draft-js that referenced this pull request Mar 24, 2020
…ve#1938)

Summary:
**Summary**

Takes over and applies requested PR feedback to facebookarchive#1877 by haikyuu.

Refer to original PR for context and discussion.

**Test Plan**

Run some manual smoke tests on the editor running in an iframe as follows:

```
yarn
python3 -m http.server 8080 .
open http://localhost:8080/examples/draft-0-10-0/iframe/iframe.html
```
Pull Request resolved: facebookarchive#1938

Reviewed By: claudiopro

Differential Revision: D13137413

Pulled By: jack-arms

fbshipit-source-id: efcdbabc7d8d2aff4fbebc8b06c22d57756ebc12
vilemj-Viclick pushed a commit to kontent-ai/draft-js that referenced this pull request Jul 16, 2020
…ve#1938)

Summary:
**Summary**

Takes over and applies requested PR feedback to facebookarchive#1877 by haikyuu.

Refer to original PR for context and discussion.

**Test Plan**

Run some manual smoke tests on the editor running in an iframe as follows:

```
yarn
python3 -m http.server 8080 .
open http://localhost:8080/examples/draft-0-10-0/iframe/iframe.html
```
Pull Request resolved: facebookarchive#1938

Reviewed By: claudiopro

Differential Revision: D13137413

Pulled By: jack-arms

fbshipit-source-id: efcdbabc7d8d2aff4fbebc8b06c22d57756ebc12
alicayan008 pushed a commit to alicayan008/draft-js that referenced this pull request Jul 4, 2023
Summary:
**Summary**

Takes over and applies requested PR feedback to #1877 by haikyuu.

Refer to original PR for context and discussion.

**Test Plan**

Run some manual smoke tests on the editor running in an iframe as follows:

```
yarn
python3 -m http.server 8080 .
open http://localhost:8080/examples/draft-0-10-0/iframe/iframe.html
```
Pull Request resolved: facebookarchive/draft-js#1938

Reviewed By: claudiopro

Differential Revision: D13137413

Pulled By: jack-arms

fbshipit-source-id: efcdbabc7d8d2aff4fbebc8b06c22d57756ebc12
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants