Skip to content

Commit 33ff4d9

Browse files
authored
Merge pull request #169 from quid/fix/QUID-27512-firefox-sorting-issue
fix: sorting issue on FireFox
2 parents 192f4d1 + 8c2740a commit 33ff4d9

File tree

6 files changed

+2256
-2154
lines changed

6 files changed

+2256
-2154
lines changed

packages/react-dropdown/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@quid/react-dropdown",
3-
"version": "4.11.1",
3+
"version": "4.11.3",
44
"description": "React dropdown component with ARIA accessibility and advanced functionalities",
55
"main": "dist/index.js",
66
"main:umd": "dist/index.umd.js",
@@ -32,6 +32,7 @@
3232
"@emotion/styled": "^10.0.6",
3333
"@emotion/styled-base": "^10.0.4",
3434
"@quid/react-core": "^4.10.0",
35+
"@quid/react-dropdown": "^4.11.1",
3536
"@quid/theme": "^4.10.0",
3637
"color": "^3.1.0",
3738
"downshift": "^3.2.0",

packages/react-dropdown/src/Categories.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,19 @@ export default function DropdownCategories({
164164

165165
// Add index to our items
166166
const itemsWithIndex = sortedItems
167-
.sort((a, b) => (String(a.categoryId) < String(b.categoryId) ? -1 : 1))
167+
.sort((a, b) => {
168+
const strA = String(a.categoryId);
169+
const strB = String(b.categoryId);
170+
if (strA < strB) {
171+
return -1;
172+
}
173+
else if (strA === strB) {
174+
return 0;
175+
}
176+
else {
177+
return 1;
178+
}
179+
})
168180
.map((item, index) => ({ ...item, index }));
169181

170182
// put the items inside their categories

packages/react-forms/src/index.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ import * as components from '.';
1010
it('exports the expected number of components', () => {
1111
expect(Object.keys(components)).toMatchInlineSnapshot(`
1212
Array [
13+
"Button",
14+
"INPUT_ATTRIBUTES",
1315
"InputCheckbox",
1416
"InputColor",
1517
"InputDate",
@@ -23,8 +25,6 @@ it('exports the expected number of components', () => {
2325
"InvalidHandler",
2426
"Label",
2527
"TextArea",
26-
"Button",
27-
"INPUT_ATTRIBUTES",
2828
]
2929
`);
3030
});

packages/react-layouts/src/index.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ import * as components from '.';
1010
it('exports the expected named exports', () => {
1111
expect(Object.keys(components)).toMatchInlineSnapshot(`
1212
Array [
13-
"Footer",
1413
"Breadcrumb",
14+
"Footer",
15+
"Modal",
1516
"NavBar",
1617
"Tabs",
17-
"Modal",
1818
]
1919
`);
2020
});

packages/theme/src/index.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ import { ThemeProvider as QuidThemeProvider } from './index';
1414
it('exports all the expected modules', () => {
1515
expect(Object.keys(exps)).toMatchInlineSnapshot(`
1616
Array [
17+
"ThemeProvider",
1718
"colors",
1819
"sizes",
1920
"textStyles",
20-
"withFallback",
21-
"ThemeProvider",
2221
"themes",
22+
"withFallback",
2323
]
2424
`);
2525
});

0 commit comments

Comments
 (0)