-
Notifications
You must be signed in to change notification settings - Fork 47k
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
Conversation
Can we do .nodeType instead? That's how we check types everywhere else. |
Remove debugger too. ;) |
Confirmed the test case does work now in IE11. Should we only do this if |
Doesn't matter much since insertTreeChildren is a noop if enableLazy is false. |
👍 I also tested Edge which seemed to be hitting this too (test case: http://playground.zpao.com/tmp/react_6246/) |
Add nodes to DocumentFragments before attaching
@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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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. :\
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment updated: 5a17a1e
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.