From 50e716e440c72f34d85880a8f02fec0565761998 Mon Sep 17 00:00:00 2001 From: Lars Eggert <lars@eggert.org> Date: Fri, 31 Mar 2023 10:38:02 +0900 Subject: [PATCH] fix: Only presort tables if sort order is specified (#5408) Thanks to @kivinen --- ietf/static/js/list.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ietf/static/js/list.js b/ietf/static/js/list.js index bd8c9df75..6a854afc0 100644 --- a/ietf/static/js/list.js +++ b/ietf/static/js/list.js @@ -277,9 +277,11 @@ $(document) const presort_col = $(header_row).children("[data-default-sort]:first"); if (presort_col) { const order = presort_col.attr("data-default-sort"); - $.each(list_instance, (i, e) => { - e.sort(presort_col.attr("data-sort"), { order: order, sortFunction: text_sort }); - }); + if (order == "asc" || order == "desc") { + $.each(list_instance, (i, e) => { + e.sort(presort_col.attr("data-sort"), { order: order, sortFunction: text_sort }); + }); + } } });