From 379fdf972aa3d34f80d1b97bb960e9d1c31f2b7d Mon Sep 17 00:00:00 2001 From: Sergey Kolesnik Date: Wed, 17 Jan 2024 22:57:39 +0300 Subject: [PATCH] feat(ui): order with respect the numeric characters --- src/ui/insert.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ui/insert.tsx b/src/ui/insert.tsx index e195c83..f28d401 100644 --- a/src/ui/insert.tsx +++ b/src/ui/insert.tsx @@ -53,9 +53,9 @@ async function prepareDataLogic(): Promise { }) return data.sort((a, b) => { // by page then by name - const pageDiff = a.page.localeCompare(b.page) + const pageDiff = a.page.localeCompare(b.page, 'en', { numeric: true }) if (pageDiff === 0) - return a.name.localeCompare(b.name) + return a.name.localeCompare(b.name, 'en', { numeric: true }) return pageDiff }) }