fix: sort bound text elements to fix text duplication z-index error (#5130)
* fix: sort bound text elements to fix text duplication z-index error * improve & sort groups & add tests * fix backtracking and discontiguous groups --------- Co-authored-by: dwelle <luzar.david@gmail.com>
This commit is contained in:
@ -607,6 +607,14 @@ export const arrayToMap = <T extends { id: string } | string>(
|
||||
}, new Map());
|
||||
};
|
||||
|
||||
export const arrayToMapWithIndex = <T extends { id: string }>(
|
||||
elements: readonly T[],
|
||||
) =>
|
||||
elements.reduce((acc, element: T, idx) => {
|
||||
acc.set(element.id, [element, idx]);
|
||||
return acc;
|
||||
}, new Map<string, [element: T, index: number]>());
|
||||
|
||||
export const isTestEnv = () =>
|
||||
typeof process !== "undefined" && process.env?.NODE_ENV === "test";
|
||||
|
||||
|
Reference in New Issue
Block a user