diff --git a/apps/client/src/features/rundown/Rundown.tsx b/apps/client/src/features/rundown/Rundown.tsx index b6e674152..bff95df95 100644 --- a/apps/client/src/features/rundown/Rundown.tsx +++ b/apps/client/src/features/rundown/Rundown.tsx @@ -489,8 +489,17 @@ export default function Rundown({ data }: RundownProps) { const isFirst = index === 0; const isLast = entryId === order.at(-1); - // avoid a group referencing itself as the parent - const parentId = rundownMetadata.thisId !== rundownMetadata.groupId ? rundownMetadata.groupId : null; + + /** + * We need to provide the parent ID for the QuickAdd components + * This should be different depending on whether we are adding before or after an element + * - when adding before, we need to avoid a group referencing itself as the parent + * - when adding after, we can use the group ID directly to insert at the top of the group + */ + + const parentIdForBefore = + rundownMetadata.thisId !== rundownMetadata.groupId ? rundownMetadata.groupId : null; + const parentIdForAfter = rundownMetadata.groupId; return ( @@ -501,7 +510,7 @@ export default function Rundown({ data }: RundownProps) { * - if it is not the first entry (the buttons would be there) */} {isEditMode && hasCursor && !isFirst && ( - + )} {isOntimeBlock(entry) ? ( + )} );