Not sure I see the use for this, if you have already constructed the element before passing it to openAsModal, why not just size it yourself?