Skip to content

Commit 1e969f9

Browse files
feat(ui): autosize image collection field grid
1 parent 9c6c86e commit 1e969f9

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/inputs/ImageFieldCollectionInputComponent.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,13 @@ export const ImageFieldCollectionInputComponent = memo(
8282
)}
8383
{field.value && field.value.length > 0 && (
8484
<>
85-
<Grid className="nopan" w="full" h="full" templateColumns="repeat(3, 1fr)" gap={2}>
85+
<Grid
86+
className="nopan"
87+
w="full"
88+
h="full"
89+
templateColumns={`repeat(${Math.min(field.value.length, 3)}, 1fr)`}
90+
gap={2}
91+
>
8692
{field.value.map(({ image_name }) => (
8793
<GridItem key={image_name}>
8894
<DndImageFromImageName imageName={image_name} asThumbnail />

0 commit comments

Comments
 (0)