Ensure that container is set before everything for dropdown.

Fixes #2394. The problem there is that if the class is declared dynamically, the children are added to the dropdown before the other rules are applied. Therefore, container would not have been set, so add widget would add the children to the scrollview resulting in errors. this ensures that the container is set early enough.