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

Re-added support for attaching events to document fragments #6462

Merged
merged 1 commit into from
Apr 14, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/renderers/dom/shared/ReactDOMComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ var RESERVED_PROPS = {
suppressContentEditableWarning: null,
};

// Node type for document fragments (Node.DOCUMENT_FRAGMENT_NODE).
var DOC_FRAGMENT_TYPE = 11;


function getDeclarationErrorAddendum(internalInstance) {
if (internalInstance) {
Expand Down Expand Up @@ -213,7 +216,8 @@ function enqueuePutListener(inst, registrationName, listener, transaction) {
);
}
var containerInfo = inst._nativeContainerInfo;
var doc = containerInfo._ownerDocument;
var isDocumentFragment = containerInfo._node && containerInfo._node.nodeType === DOC_FRAGMENT_TYPE;
var doc = isDocumentFragment ? containerInfo._node : containerInfo._ownerDocument;
if (!doc) {
// Server rendering.
return;
Expand Down
1 change: 1 addition & 0 deletions src/renderers/dom/shared/ReactDOMContainerInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ function ReactDOMContainerInfo(topLevelWrapper, node) {
_ownerDocument: node ?
node.nodeType === DOC_NODE_TYPE ? node : node.ownerDocument :
null,
_node: node,
_tag: node ? node.nodeName.toLowerCase() : null,
_namespaceURI: node ? node.namespaceURI : null,
};
Expand Down