I thought setting the maximum size of the dialog before adding the box container might provide a workaround, but it doesn't