web/elements: fix dual select without sortBy (#14977) Signed-off-by: Jens Langhammer <jens@goauthentik.io> Co-authored-by: Jens L. <jens@goauthentik.io>
This commit is contained in:
committed by
GitHub
parent
b94fb53821
commit
7a4518be26
@ -32,8 +32,8 @@ import {
|
||||
} from "./types.js";
|
||||
|
||||
function localeComparator(a: DualSelectPair, b: DualSelectPair) {
|
||||
const aSortBy = a[2];
|
||||
const bSortBy = b[2];
|
||||
const aSortBy = a[2] || a[0];
|
||||
const bSortBy = b[2] || a[0];
|
||||
|
||||
return aSortBy.localeCompare(bSortBy);
|
||||
}
|
||||
|
||||
@ -34,7 +34,7 @@ export type DualSelectPair<T = unknown> = [
|
||||
/**
|
||||
* A string to sort by. If not provided, the key will be used.
|
||||
*/
|
||||
sortBy: string,
|
||||
sortBy?: string,
|
||||
/**
|
||||
* A local mapping of the key to the object. This is used by some specific apps.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user