Compare commits

...

2 Commits

View File

@ -38,7 +38,6 @@ class UiSelect extends UiElement implements Extension {
protected function setList(array $list, $selected, bool $strict = true) : void protected function setList(array $list, $selected, bool $strict = true) : void
{ {
foreach($list as $key => $item) { foreach($list as $key => $item) {
if ($item instanceof UiElement) { if ($item instanceof UiElement) {
$this->append($item); $this->append($item);
@ -49,13 +48,13 @@ class UiSelect extends UiElement implements Extension {
$obj->attributes(['label' => $key]); $obj->attributes(['label' => $key]);
foreach($item as $subKey => $subItem) { foreach($item as $subKey => $subItem) {
$obj->append($this->createOption($subItem, $subKey, $this->isSelected($subKey, $selected, $strict))); $obj->append($this->createOption((string) $subItem, $subKey, $this->isSelected($subKey, $selected, $strict)));
} }
} }
else { else {
$obj = $this->createOption($item, $key, $this->isSelected($key, $selected, $strict)); $obj = $this->createOption((string) $item, $key, $this->isSelected($key, $selected, $strict));
} }
$this->append($obj); $this->append($obj);
} }
} }