-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[Bug]: Changes in the canvas within the Shadow DOM cannot be recorded #1412
Labels
bug
Something isn't working
Comments
It appears that the issue was caused by the CanvasManager's method for retrieving canvas elements not correctly accessing the canvas within the shadow DOM. After modifying the getCanvas method, I was able to resolve this problem. const getCanvas = () => {
const matchedCanvas = [];
const searchCanvas = (root) => {
root.querySelectorAll('canvas').forEach((canvas) => {
if (!isBlocked(canvas, blockClass, blockSelector, true)) {
matchedCanvas.push(canvas);
}
});
root.querySelectorAll('*').forEach((elem) => {
if (elem.shadowRoot) {
searchCanvas(elem.shadowRoot);
}
});
};
searchCanvas(win.document);
return matchedCanvas;
};
``` |
Libra-Lei
pushed a commit
to Libra-Lei/rrweb
that referenced
this issue
Feb 20, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Preflight Checklist
What package is this bug report for?
rrweb
Version
v2.0.0-alpha.4
Expected Behavior
Changes in the canvas within the Shadow DOM should be recorded (for example, changes in chart content display after the initialization of echarts charts).
Actual Behavior
Currently, only the initial snapshot has been recorded, and subsequent changes to the canvas have not been captured.
Steps to Reproduce
Here is a test case:
Testcase Gist URL
No response
Additional Information
No response
The text was updated successfully, but these errors were encountered: