How to autoresize popup window when clicking a dropdown (select2)

How to autoresize popup window when clicking a dropdown (select2)

  

Hi,

I have a small popup with one dropdown (select2) in it. When the dropdown is extended some ugly scrollbars appear; instead I would like the popup to resize itself to allow the dropdown to grow and shrink back once the dropdown is again collapsed. Any ideas?

All I could find so far is https://success.outsystems.com/Documentation/Development_FAQs/How_to_dynamically_resize_a_pop-up_window but I don't know how to start. 

I'm thinking in order to make the popup expand, I need to trigger an ajax refresh of an element in the popup in order to trigger the built-in popup autoresize. However I don't know how to catch the event of the dropdown extending. And what element to refresh? Any tips?


To collapse back the popup I probably need to call PopupEditor_ForceResize() JavaScript action in the OnChange() action of the DropDown, right?


Thanks for your help!

Kind regards,

Adrian

Hello Adrian,

The Select2 has JavaScript to deal with the autocomplete. And it changes the way the combo box works is presented. You should inspect the combo box to see if there is something you can change in terms of CSS that will make the auto resize to work properly (instead of showing scroll bars).

MAYBE a change in the CSS will solve this, but I think that probably the only way will be to change the component's JavaScript (just a guess, though). IN this case, you would have to clone the component..  

Cheers

Good question Adrian! I would be interested to know the answer as well, if someone manages to figure this out.

Art