Resizing inline Excalidraw in canvas not working

I created a excalidraw document that works fine and scales properly when I open it on its own. But when I add it to a canvas the excalidraw file does not scale to the rectangle I have specified.
Is there somethings I am missing?