From 376220c557607bfa136b5f5496fc05daedd617af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxi=20Quo=C3=9F?= Date: Sat, 11 Feb 2023 22:08:39 +0100 Subject: [PATCH] natural sort devices by name meaning, 1-2-10 instead of 1-10-2 --- frontend/src/sorts.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/frontend/src/sorts.js b/frontend/src/sorts.js index 83040255..7b0dfe6d 100644 --- a/frontend/src/sorts.js +++ b/frontend/src/sorts.js @@ -1,5 +1,8 @@ export function sortDevices(a, b) { - return a.name > b.name; + return a.name.localeCompare(b.name, undefined, { + numeric: true, + sensitivity: 'base' + }); } export function sortPorts(a, b) {