mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-23 17:26:42 +00:00
parent
81e4f083f9
commit
e242fbe148
@ -200,7 +200,6 @@ export class HaDataTable extends LitElement {
|
||||
Object.values(clonedColumns).forEach(
|
||||
(column: ClonedDataTableColumnData) => {
|
||||
delete column.title;
|
||||
delete column.type;
|
||||
delete column.template;
|
||||
}
|
||||
);
|
||||
|
@ -55,12 +55,17 @@ const sortData = (
|
||||
? b[column.valueColumn || sortColumn][column.filterKey]
|
||||
: b[column.valueColumn || sortColumn];
|
||||
|
||||
if (column.type === "numeric") {
|
||||
valA = isNaN(valA) ? undefined : Number(valA);
|
||||
valB = isNaN(valB) ? undefined : Number(valB);
|
||||
} else {
|
||||
if (typeof valA === "string") {
|
||||
valA = valA.toUpperCase();
|
||||
}
|
||||
if (typeof valB === "string") {
|
||||
valB = valB.toUpperCase();
|
||||
}
|
||||
}
|
||||
|
||||
// Ensure "undefined" is always sorted to the bottom
|
||||
if (valA === undefined && valB !== undefined) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user