I didn’t add custom styling to the canvas because I noticed that the height and width are calculated automatically. But the parent containers of it are set by percentage (100%).
I include a video here where you will see at first when I resized the screen slowly canvas size adjusts perfectly fine. But when I quickly resized the screen then the issue occurs wherein the canvas is cut and not 100% anymore based on its container and it messes up the view. I hope there is a kind of available method which re-calculates the canvas.