Skip to content

New window does not have a defined DOCTYPE, so renders in quirks mode #155

@RobRendell

Description

@RobRendell

The content of the new window does not copy the parent window's DOCTYPE, and as a result the contents are being rendered in quirks mode in Chrome (and probably other browsers).

Since create-react-app inserts <!DOCTYPE html> at the top of index.html, this can lead to inconsistencies in components rendered in the new window vs. rendered in the original app. For example, tables in quirks mode do not inherit their text colour from their parent, while in strict mode they do.

If it is not possible to automatically copy the DOCTYPE of the parent window, adding an optional "doctype" prop to NewWindow we can use to set the DOCTYPE in the new window manually might be another way to deal with this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions