Interestingly, I do not seam to find a simple solution for a simple requirement of having list of select options open / dropped down on page load.
I am working with Angular 8 in case that offers some simple script, but I was assuming HTML/CSS should have this built in with some property - such as: 'isOpen' or 'isDroppedDown' ...
I see some are resolving it with 'size' or 'multiple', but these change the visual property of the control and I want consistency. The control needs to be/look the same (with the little arrow ...)
Code example: Say we have this list/array in TS/Angular code:
philosophers = ['Aristotle', 'Epicurus', 'Descartes', 'Seneca', 'Plato'];
and we feed it to this template:
<select name="phil_selector" [(ngModel)]="selected_phil">
<option *ngFor="let item of philosophers; index as ix" [value]="ix">
{{item}}
</option>
</select>
// For those who prefer plain HTML:
<select name="phil_selector">
<option value="0"></option>
<option value="1">Aristotle</option>
<option value="2">Epicurus</option>
<option value="3">Descartes</option>
<option value="4">Seneca</option>
<option value="5">Plato</option>
</select>
We do not want any item/philosopher be selected by default, but when the page loads, we want the drop-box be already open, to make it clear to the user, that 1st thing he has to do, is to make his selection from the visible list of options. So he will see this:
And, he just clicks on his choice and goes on ...
To summarize the requirement - we need to have a list of 'select' options open (dropped down) after HTML page has loaded.