Unsteady appearance of modal window dialog when pre-selecting items in List

In my modal window I have a list select and few other fields. List select is populated with multiple items and multiselect option is enabled for it. When I open this child window over the main window the dialog moves to the top left corner and then positions itself to the center of the screen. This happens only when I’m preselecting multiple values in List select before opening the dialog programmatically.
If I preselect a single item it works fine with no unsteady appearance of dialog. There seems to be a lag before rendering the dailog during multiselection of items in List Select. Can anyone help me out how to overcome this.

I have tried 2 options:

  1. ListSelect.setValue(list_of_items) : passing in a list of items and setting the selection.
  2. Looping through each of the items in the list and calling ListSelect.select(item) within the loop.