mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-21 13:50:20 +08:00
Sort value in multiselect setter
This commit is contained in:
@@ -109,6 +109,17 @@ const currentValue = computed({
|
||||
return null;
|
||||
},
|
||||
set: (val) => {
|
||||
if (val && Array.isArray(val) && val.length > 0) {
|
||||
val.sort((a, b) => {
|
||||
const aHid = a.hid;
|
||||
const bHid = b.hid;
|
||||
if (aHid && bHid) {
|
||||
return aHid - bHid;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
});
|
||||
}
|
||||
$emit("input", createValue(val));
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user