SelectBox selectedIndexes ctor overload
Since a SelectBox can have multiple selections, it would be useful to have a constructor overload which takes in a List<int> to specify multiple SelectedIndexes.
-
Shaya commented
I'm using this for now:
```
class MySelectBox : SelectBox{
public MySelectBox(SelectBoxKind kind, object[] options, List<int> selectedIndexes) : base(kind, options)
{
var _setSelectedIndexes = @"function getSelectedIndexes(id, indexes) {
var selectOptions = document.getElementById(id).options;
indexes.forEach(function(i) {if(!selectOptions[i]) return; selectOptions[i].selected = true});
}";
HtmlElement.InvokeScript("eval", $"({ _setSelectedIndexes})('{HtmlElement.ID}', [{string.Join(",", selectedIndexes)}])");
}
}
```