fix: выбранные позиции справочника отображаются горизонтально рядом с полем
This commit is contained in:
@@ -142,9 +142,10 @@ export default function TableFieldMultiSelect({
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
<div className="flex flex-wrap items-center gap-1 w-full">
|
||||||
<Popover open={isOpen} onOpenChange={setIsOpen} modal={false}>
|
<Popover open={isOpen} onOpenChange={setIsOpen} modal={false}>
|
||||||
<PopoverAnchor asChild>
|
<PopoverAnchor asChild>
|
||||||
<div className="relative w-full">
|
<div className="relative flex-1 min-w-[120px]">
|
||||||
<Input
|
<Input
|
||||||
ref={inputRef}
|
ref={inputRef}
|
||||||
className="h-8"
|
className="h-8"
|
||||||
@@ -217,12 +218,11 @@ export default function TableFieldMultiSelect({
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</PopoverContent>
|
</PopoverContent>
|
||||||
{selectedLabels.length > 0 && (
|
</Popover>
|
||||||
<div className="flex flex-wrap gap-1 mt-1.5">
|
|
||||||
{selectedLabels.map((label, idx) => {
|
{selectedLabels.map((label, idx) => {
|
||||||
const rowId = selectedValues[idx];
|
const rowId = selectedValues[idx];
|
||||||
return (
|
return (
|
||||||
<div key={rowId} className="inline-flex items-center gap-1 px-1.5 py-0.5 rounded bg-muted text-xs">
|
<div key={rowId} className="inline-flex items-center gap-1 px-1.5 py-0.5 rounded bg-muted text-xs shrink-0">
|
||||||
<span className="truncate max-w-[150px]">{label}</span>
|
<span className="truncate max-w-[150px]">{label}</span>
|
||||||
<Button
|
<Button
|
||||||
type="button"
|
type="button"
|
||||||
@@ -237,7 +237,5 @@ export default function TableFieldMultiSelect({
|
|||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
)}
|
|
||||||
</Popover>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user