Unverified Commit f6bf604b authored by davelopez's avatar davelopez
Browse files

Do not sort FormData values by HID

parent 71fe2ff8
Loading
Loading
Loading
Loading
+0 −21
Original line number Diff line number Diff line
@@ -145,17 +145,6 @@ const currentValue = computed({
        return undefined;
    },
    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));
    },
});
@@ -222,16 +211,6 @@ const formattedOptions = computed(() => {
                }
            }
        });
        // Sort entries by hid
        result.sort((a, b) => {
            const aHid = a.value && a.value.hid;
            const bHid = b.value && b.value.hid;
            if (aHid && bHid) {
                return bHid - aHid;
            } else {
                return 0;
            }
        });
        // Add optional entry
        if (!currentVariant.value?.multiple && props.optional) {
            result.unshift({