-
Notifications
You must be signed in to change notification settings - Fork 104
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
capture slotted elements #179
Conversation
src/dom-to-image-more.js
Outdated
@@ -97,8 +97,8 @@ | |||
let restorations = []; | |||
return Promise.resolve(node) | |||
.then(ensureElement) | |||
.then(function (clonee) { | |||
return cloneNode(clonee, options, null, ownerWindow); | |||
.then(function (clone) { |
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.
This is NOT a typo, the intent here is to ensure that the clone
in scope isn't hidden by this name.
Please revert these two lines
src/dom-to-image-more.js
Outdated
@@ -439,8 +439,14 @@ | |||
|
|||
function getRenderedChildren(original) { | |||
if (util.isShadowSlotElement(original)) { | |||
return original.assignedNodes(); // shadow DOM <slot> has "assigned nodes" as rendered children | |||
const childElement = [ |
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.
So we're essentially union
ing these two arrays... I assume there's no path by which the same nodes appear in both childNodes
and assignedNodes
(e.g. we're not going to generate duplicate nodes doing this.
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.
You gave a good point here, we should not use the union, the assigned nodes actually will cover default content/node(original childNodes). Should use or
relation here. I will update the code. Here's my test example:https://jsfiddle.net/CWenyu/wanphkx2/49/
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.
By the way, do you have suggestions on a starting point for the progress bar styling? I've been struggling with that for a few days 😵
Manually merged this in 3.4.0 |
Fix issue #178
Also fix a typo