diff --git a/frontend/src/components/MultiSelectChips.tsx b/frontend/src/components/MultiSelectChips.tsx index 0796d816..343794a3 100644 --- a/frontend/src/components/MultiSelectChips.tsx +++ b/frontend/src/components/MultiSelectChips.tsx @@ -51,7 +51,7 @@ export default function MultiSelectChips({ const inputRef = useRef(null); const fade = useScrollFade(); - const { refs, floatingStyles, context } = useFloating({ + const { refs, floatingStyles, context, isPositioned } = useFloating({ open, onOpenChange: setOpen, placement: "bottom-start", @@ -62,12 +62,10 @@ export default function MultiSelectChips({ shift({ padding: 8 }), size({ padding: 8, - apply({ rects, elements, availableHeight }) { - // Match the field width and cap to the space below (or 320px, whichever is smaller). - Object.assign(elements.floating.style, { - width: `${rects.reference.width}px`, - maxHeight: `${Math.min(availableHeight, 320)}px`, - }); + apply({ rects, elements }) { + // Match the field width (with a sane minimum for a very narrow rail); the inner scroll box + // owns the height cap (max-h-64). + elements.floating.style.width = `${Math.max(rects.reference.width, 192)}px`; }, }), ], @@ -166,15 +164,22 @@ export default function MultiSelectChips({