diff --git a/api/js/etemplate/Et2Select/FindSelectOptions.ts b/api/js/etemplate/Et2Select/FindSelectOptions.ts index 4fbbbf3eb0..6f90117882 100644 --- a/api/js/etemplate/Et2Select/FindSelectOptions.ts +++ b/api/js/etemplate/Et2Select/FindSelectOptions.ts @@ -194,8 +194,7 @@ export function find_select_options(widget, attr_options?, options : SelectOptio // @ts-ignore Yes, option.label.label is not supposed to exist but that's what we're checking if(typeof option.label.label !== "undefined") { - // @ts-ignore Yes, option.label.label is not supposed to exist but that's what we're checking - option.label = option.label.label; + option = Object.assign(option, option.label); } } fixed_options.push(option); diff --git a/api/src/Etemplate/Widget/Select.php b/api/src/Etemplate/Widget/Select.php index 02bb4fe3cd..600baeed6b 100644 --- a/api/src/Etemplate/Widget/Select.php +++ b/api/src/Etemplate/Widget/Select.php @@ -144,7 +144,7 @@ class Select extends Etemplate\Widget { $form_name = self::form_name($cname, $this->id, $expand); $widget_type = $this->attrs['type'] ? $this->attrs['type'] : $this->type; - $multiple = $this->attrs['multiple'] || $this->getElementAttribute($form_name, 'rows') > 1; + $multiple = $this->attrs['multiple'] || $this->getElementAttribute($form_name, 'multiple') || $this->getElementAttribute($form_name, 'rows') > 1; $ok = true; if (!$this->is_readonly($cname, $form_name)) @@ -998,4 +998,6 @@ class Select extends Etemplate\Widget $response->data($options); } } -Etemplate\Widget::registerWidget(__NAMESPACE__.'\\Select', array('selectbox', 'listbox', 'select', 'menupopup')); \ No newline at end of file + +Etemplate\Widget::registerWidget(__NAMESPACE__ . '\\Select', array('et2-select', 'selectbox', 'listbox', 'select', + 'menupopup')); \ No newline at end of file