- Small bugfixes within value comparison for UiInput and small bugfixe in select repairing broken options.

This commit is contained in:
Dave Mc Nicoll committed 2020-05-20 15:32:41 -04:00
1 parent b4fc4dd37f
commit 69c7121981
4 files changed
+14 -9

No files matched your search

+3 -5
View File
@@ -38,24 +38,22 @@ class UiSelect extends UiElement implements Extension {
protected function setList(array $list, $selected, bool $strict = true) : void
{
foreach($list as $key => $item) {
$isSelected = $this->isSelected($key, $selected, $strict);
if ($item instanceof UiElement) {
$this->append($item);
continue;
}
elseif ( is_array($item) ) {
$obj = new UiElement("optgroup");
$obj->text($key);
$obj->attributes(['label' => $key]);
foreach($item as $subKey => $subItem) {
$obj->append($this->createOption($subItem, $subKey, $isSelected));
$obj->append($this->createOption($subItem, $subKey, $this->isSelected($subKey, $selected, $strict)));
}
}
else {
$obj = $this->createOption($item, $key, $isSelected);
$obj = $this->createOption($item, $key, $this->isSelected($key, $selected, $strict));
}
$this->append($obj);