Rendering delay

I notice that when I create my HTML widget and use JS to attach the select2 object, there is a half second delay where the widget displays as HTML and the renders as select2. This is noticeable to the user and looks like a flutter of the widget. Is select2 used in production systems and if so, how to circumvent this poor behavior?

Thanks / Don

You could just hide the SELECT with CSS (e.g., <select style="visibility: hidden;" ...>). That will prevent the HTML version of the SELECT from displaying at all, but will reserve the space in the layout that the SELECT would take up (which will be filled by the select2 widget once it initializes).

FYI, there is a term for this in the web developer world - it’s called Flash of Unstyled Content.