Skip to content

Commit 8932dda

Browse files
committed
fix: use natural sort on custom sound picker again
1 parent abf846b commit 8932dda

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

web/src/modules/song/components/client/SongSearchCombo.tsx

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,21 @@ export function SongSearchCombo({
3535

3636
let returnCount = 0;
3737

38-
const filteredSounds = sounds.filter((sound) => {
39-
if (
40-
returnCount < 100 &&
41-
sound.toLowerCase().includes(searchTerm.toLowerCase())
42-
) {
43-
returnCount++;
44-
return true;
45-
}
38+
const filteredSounds = sounds
39+
.filter((sound) => {
40+
if (
41+
returnCount < 100 &&
42+
sound.toLowerCase().includes(searchTerm.toLowerCase())
43+
) {
44+
returnCount++;
45+
return true;
46+
}
4647

47-
return false;
48-
});
48+
return false;
49+
})
50+
.sort((a, b) =>
51+
a.localeCompare(b, undefined, { sensitivity: 'base', numeric: true }),
52+
);
4953

5054
return (
5155
<Popover open={open} onOpenChange={setOpen}>

0 commit comments

Comments
 (0)