Skip to content

Commit 21894d9

Browse files
committed
sort the chips in the cell renderer
Signed-off-by: David BRAQUART <[email protected]>
1 parent f5708a7 commit 21894d9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/pages/common/multi-chip-cell-renderer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export interface MultiChipCellRendererProps {
3030
}
3131

3232
const MultiChipCellRenderer = (props: MultiChipCellRendererProps) => {
33-
const values: string[] = props.value || [];
33+
const values: string[] = props.value ? [...props.value].sort((a: string, b: string) => a.localeCompare(b)) : [];
3434
const containerRef = useRef<HTMLDivElement>(null);
3535
const [chipLimit, setChipLimit] = useState<number>(5);
3636

0 commit comments

Comments
 (0)