### What problem does this PR solve? feat: The order of the category operator form is messed up after refreshing the page #3088 ### Type of change - [ ] Bug Fix (non-breaking change which fixes an issue) - [x] New Feature (non-breaking change which adds functionality) - [ ] Documentation Update - [ ] Refactoring - [ ] Performance Improvement - [ ] Other (please describe):
This commit is contained in:
@@ -29,13 +29,15 @@ export const useBuildCategorizeHandlePositions = ({
|
||||
idx: number;
|
||||
}> = [];
|
||||
|
||||
Object.keys(categoryData).forEach((x, idx) => {
|
||||
list.push({
|
||||
text: x,
|
||||
idx,
|
||||
top: idx === 0 ? 98 : list[idx - 1].top + 8 + 26,
|
||||
Object.keys(categoryData)
|
||||
.sort((a, b) => categoryData[a].index - categoryData[b].index)
|
||||
.forEach((x, idx) => {
|
||||
list.push({
|
||||
text: x,
|
||||
idx,
|
||||
top: idx === 0 ? 98 : list[idx - 1].top + 8 + 26,
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
return list;
|
||||
}, [categoryData]);
|
||||
|
||||
Reference in New Issue
Block a user