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

DraftJS is not actually stateless #527

@quangbuule

Description

@quangbuule

When I tried to render DraftJS into an iframe window, for example:

ReactDOM.render(<DraftEditor .../>,
  document
    .getElementById('some_iframe')
    .contentWindow
    .document
    .getElementById('some_inner_element'))

inside the DraftJS functions, there were window, global, document variables, which were global variables, still referenced to the parent window (the window that run the above snippet).
So, global.getSelection, node !== document.documentElement didn't work.

Render components inside iframe is important for isolating CSS especially rem unit.
Looking forward to having a discussion around this. Thank you all!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions