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

Add nodes to DocumentFragments before attaching #6251

Merged
merged 1 commit into from
Mar 11, 2016

Conversation

zpao
Copy link
Member

@zpao zpao commented Mar 11, 2016

This is based on a quick chat with @spicyj. I haven't tested in IE11 yet (setting that up now), but after ensuring Firefox is running in lazy mode here, this does do what Ben was thinking, at least for the insert case. I need to do some more testing and see if this is an issue with updates (I think we should be ok there but will check).

Fixes #6246.

@zpao zpao added this to the 15.0 milestone Mar 11, 2016
@sophiebits
Copy link
Collaborator

Can we do .nodeType instead? That's how we check types everywhere else.

@sophiebits
Copy link
Collaborator

Remove debugger too. ;)

@zpao
Copy link
Member Author

zpao commented Mar 11, 2016

Confirmed the test case does work now in IE11. Should we only do this if enableLazy is true @spicyj? Is it going to make much of a difference?

@sophiebits
Copy link
Collaborator

Doesn't matter much since insertTreeChildren is a noop if enableLazy is false.

@zpao
Copy link
Member Author

zpao commented Mar 11, 2016

👍 I also tested Edge which seemed to be hitting this too (test case: http://playground.zpao.com/tmp/react_6246/)

zpao added a commit that referenced this pull request Mar 11, 2016
Add nodes to DocumentFragments before attaching
@zpao zpao merged commit 2326d1a into facebook:master Mar 11, 2016
@facebook-github-bot
Copy link

@zpao updated the pull request.

@@ -53,8 +53,16 @@ function insertTreeChildren(tree) {

var insertTreeBefore = createMicrosoftUnsafeLocalFunction(
function(parentNode, tree, referenceNode) {
parentNode.insertBefore(tree.node, referenceNode);
insertTreeChildren(tree);
// Document Fragments in IE11, Edge (and possibly others) won't update
Copy link
Collaborator

Choose a reason for hiding this comment

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

Sorry if it was unclear: this is how doc fragments work in all browsers. But we insert things in a different order in IE11 and Edge which is why they exhibit this bug.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Would running a separate test with a mocked "is IE" flag help prevent the issue?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah, we should run jest tests with enableLazy on. :\

Copy link
Member Author

Choose a reason for hiding this comment

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

Comment updated: 5a17a1e

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

Successfully merging this pull request may close these issues.

4 participants