Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v15-rc1 seems to skip some text nodes in IE #6246

Closed
heapx opened this issue Mar 11, 2016 · 6 comments
Closed

v15-rc1 seems to skip some text nodes in IE #6246

heapx opened this issue Mar 11, 2016 · 6 comments

Comments

@heapx
Copy link

heapx commented Mar 11, 2016

The following

var Hello = React.createClass({
  render: function() {
    return <div><p>Hello</p>test</div>;
  }
});

results in only "Hello" being written in IE11 - jsfiddle

I realize there has been some changes to the way text nodes work in v15, but before we update our code to use <span>, I wanted to check if this is the intended behavior (since "test" is written in chrome).

@syranide
Copy link
Contributor

This is certainly a bug. cc @spicyj @zpao

@gaearon
Copy link
Collaborator

gaearon commented Mar 11, 2016

I can reproduce it in IE11.
Edge seems fine though.

@dittos
Copy link
Contributor

dittos commented Mar 11, 2016

It seems that DOMLazyTree having different behaviour on IE causes this bug. (also reproduced in Edge)

@dittos
Copy link
Contributor

dittos commented Mar 11, 2016

Every text node is skipped. (minimal repro case: jsfiddle)

A ReactDOMTextComponent returns DOMLazyTree something like:

{
    node: DocumentFragment,
    children: [
        { node: Comment },
        { node: Text },
        { node: Comment }
    ]
}

Then DocumentFragment is inserted into the parent element before the children are added to the fragment, so nothing is rendered.

@sophiebits
Copy link
Collaborator

Darn it, I remember considering this a few months back but must have forgotten. Easiest solution might be to treat document fragments specially in DOMLazyTree but I'm open to other ideas.

cc @mwiencek if you're interested

@zpao
Copy link
Member

zpao commented Mar 11, 2016

Thanks to everybody for the quick find and reduction! This is exactly how the process should work ♥️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants