Skip to content

A modern and easy to use dashboard. 80+ integrations. 20K+ icons built in. Authentication out of the box. No YAML, drag and drop configuration.

fix(board): tiles order not respected on firefox (#1770)

Meier Lukas8893b72fe363
diff --git a/apps/nextjs/src/components/board/sections/content.tsx b/apps/nextjs/src/components/board/sections/content.tsx
index c9fe9feab..fd8b4b552 100644
--- a/apps/nextjs/src/components/board/sections/content.tsx
+++ b/apps/nextjs/src/components/board/sections/content.tsx
@@ -10,6 +10,12 @@ import { useSectionContext } from "./section-context";
export const SectionContent = () => {
const { section, innerSections, refs } = useSectionContext();
const board = useRequiredBoard();
+
+ /**
+ * IMPORTANT: THE ORDER OF THE BELOW ITEMS HAS TO MATCH THE ORDER OF
+ * THE ITEMS RENDERED WITH GRIDSTACK, OTHERWISE THE ITEMS WILL BE MIXED UP
+ * @see https://github.com/homarr-labs/homarr/pull/1770
+ */
const sortedItems = useMemo(() => {
return [
...section.items.map((item) => ({ ...item, type: "item" as const })),
@@ -19,7 +25,7 @@ export const SectionContent = () => {
return itemA.xOffset - itemB.xOffset;
}
- return itemA.yOffset - itemB.xOffset;
+ return itemA.yOffset - itemB.yOffset;
});
}, [section.items, innerSections]);