mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-03-06 15:30:13 +01:00
Automatically select the first option of part multi select.
This commit is contained in:
@@ -76,6 +76,11 @@ export default class extends DatatablesController {
|
||||
|
||||
tom_select.addOptions(json, false);
|
||||
|
||||
//Select first element if there is one (so category select is not empty)
|
||||
if(json.length > 0) {
|
||||
tom_select.setValue(json[0].value);
|
||||
}
|
||||
|
||||
select_element.nextElementSibling.classList.remove('d-none');
|
||||
|
||||
//$(select_element).selectpicker('show');
|
||||
|
||||
Reference in New Issue
Block a user