There seems to be an issue with the code below. When I click the button next to the canvas, my intention is to have a new window open displaying the canvas in full view. However, it's not working as expected. Can someone please assist me in troubleshooting this problem? Any help would be greatly appreciated. Thank you.
const openCanvasPopup = () => {
const newWindow = window.open("", "_blank");
if (newWindow) {
let newCanvasElement = document.createElement('canvas');
newCanvasElement.id = "canvasPopup";
newCanvasElement.width = newWindow.innerWidth;
newCanvasElement.height = newWindow.innerHeight;
newWindow.document.body.appendChild(newCanvasElement);
const newCanvas = new fabric.Canvas('canvasPopup');
newCanvas.loadFromJSON(jsonData.value, () => {
newCanvas.renderAll();
});
}
};