diff --git a/source/php/Component/Drawer/drawer.blade.php b/source/php/Component/Drawer/drawer.blade.php index 31705111..72ebd9ca 100644 --- a/source/php/Component/Drawer/drawer.blade.php +++ b/source/php/Component/Drawer/drawer.blade.php @@ -14,11 +14,10 @@ 'data-simulate-click' => $simulateClickSelector ], 'classList' => [ - 'c-drawer__close' + 'c-drawer__close', ], 'size' => 'md', 'text' => $label, - 'context' => 'drawer.closeButton' ]) @endbutton diff --git a/source/php/Component/Select/Select.php b/source/php/Component/Select/Select.php index 39374fbd..30cd44e5 100644 --- a/source/php/Component/Select/Select.php +++ b/source/php/Component/Select/Select.php @@ -9,8 +9,11 @@ public function init() //Extract array for eazy access (fetch only) extract($this->data); - //Create an random id if not assigned to the component. - $this->data['id'] = $id = $id ? $id : uniqid(); + // Must include a id. + if (empty($id)) { + $id = $this->data['id'] = uniqid(); + } + $this->data['attributeList']['id'] = "select_{$id}"; //Set icon size $this->data['iconSize'] = $this->getIconSize($size); @@ -59,7 +62,7 @@ public function init() } $this->data['intersection'] = []; - if (is_array($preselected) && !empty($options)) { + if (!empty($options) && is_array($preselected)) { // Create an associative array from $preselected with keys same as values $preselectedKeys = array_flip($preselected);