Fix bug with rendering modal's content view before showing the container element when calculating size of attachment