Skip to content

Conversation

cherifGsoul
Copy link
Member

Fixes #710

The changes:

The logic changes are in this line

return res == null ? "" : ""+res;

  • Check if the returning result of branchRenderer is a DocumentFragment instance, in this case return the textContent of this result, ""+res doesn't cast DocumentFragment instance to string.

Copy link
Contributor

@matthewp matthewp left a comment

Choose a reason for hiding this comment

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

Please change how it checks for document fragments. Otherwise looks good.

if (res == null) {
return "";
}
if (res instanceof DocumentFragment) {
Copy link
Contributor

Choose a reason for hiding this comment

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

instead of checking instanceof, check res.nodeType === 11 which is a document fragment.

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated!

@cherifGsoul cherifGsoul requested a review from matthewp August 14, 2019 18:26
Copy link
Contributor

@matthewp matthewp left a comment

Choose a reason for hiding this comment

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

lgtm

@cherifGsoul cherifGsoul merged commit c7811b8 into master Aug 14, 2019
@cherifGsoul cherifGsoul deleted the i710-fix-named-partial-string-only-state branch August 14, 2019 18:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Named Partials render with documentFragment in stringOnly state instead of expected string result
2 participants