Width of Canvas tag is not updating

I am facing issue like when i click on sidenav bar the canvas tag get modified with its dynamic width property but its not getting to its original state when click again on the sidenav bar where the canvas remains the same width. But when i click on the body of the window or browser its getting modified with new width.

How to trigger the canvas event to get the dynamic width

I’m not sure what your situation is, but this might help: