mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-14 12:56:37 +00:00
Sort null and undefined at the bottom in data-table (#15651)
Sort null and undefined at the bottom in datatable
This commit is contained in:
parent
1a1c00ba62
commit
2ab8bba4b0
@ -67,11 +67,11 @@ const sortData = (
|
||||
}
|
||||
}
|
||||
|
||||
// Ensure "undefined" is always sorted to the bottom
|
||||
if (valA === undefined && valB !== undefined) {
|
||||
// Ensure "undefined" and "null" are always sorted to the bottom
|
||||
if (valA == null && valB != null) {
|
||||
return 1;
|
||||
}
|
||||
if (valB === undefined && valA !== undefined) {
|
||||
if (valB == null && valA != null) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user