Skip to content

Commit 50599dc

Browse files
authored
Merge pull request #117 from bleu/luiza/prkmain-201-display-full-tag-text-in-participant-tag-picker
TaggablePopover show all tags and fix color picker preview
2 parents cbab6c7 + bc34455 commit 50599dc

File tree

2 files changed

+18
-31
lines changed

2 files changed

+18
-31
lines changed

src/components/FormBuilder/fields/selects/ColorPickerField.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,9 @@ export const ColorPickerField = withConditional<ColorPickerFieldProps>(
8989
colorPickerVariants(field.style)
9090
)}
9191
>
92-
{formField.value && <span className="ml-3">#</span>}
92+
<span className={cn("ml-3", !formField.value && "invisible")}>
93+
#
94+
</span>
9395
<input
9496
type="text"
9597
className="p-2 mx-0 flex-1 border-0 border-transparent bg-transparent file:border-0 file:bg-transparent file:text-sm file:font-medium focus:border-transparent focus:ring-0"
@@ -103,7 +105,7 @@ export const ColorPickerField = withConditional<ColorPickerFieldProps>(
103105
<Popover>
104106
<PopoverTrigger asChild>
105107
<div
106-
className="mr-2 size-7 rounded-full border shadow-lg"
108+
className="mr-2 h-7 w-7 shrink-0 rounded-full border shadow-lg"
107109
style={{ background: formField.value ?? "#aabbcc" }}
108110
/>
109111
</PopoverTrigger>

src/components/TaggablePopover.tsx

Lines changed: 14 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -121,40 +121,25 @@ export const TaggablePopover = ({
121121
<Button
122122
variant="outline"
123123
size="sm"
124-
className="my-4 h-8 border-dashed dark:border-2"
124+
className="my-4 h-auto min-h-8 border-dashed dark:border-2"
125125
>
126-
<PlusCircledIcon className="mr-2 h-4 w-4" />
126+
<PlusCircledIcon className="mr-2 h-4 w-4 shrink-0" />
127127
Tags
128128
{selectedTags?.length > 0 && (
129129
<>
130130
<Separator orientation="vertical" className="mx-2 h-4" />
131-
<Badge
132-
color="secondary"
133-
className="rounded-sm px-1 font-normal lg:hidden"
134-
>
135-
{selectedTags.length}
136-
</Badge>
137-
<div className="hidden space-x-1 lg:flex">
138-
{selectedTags.length > 2 ? (
139-
<Badge
140-
color="secondary"
141-
className="rounded-sm px-1 font-normal"
142-
>
143-
{selectedTags.length} tags
144-
</Badge>
145-
) : (
146-
tags
147-
.filter((option) => selectedTags.includes(option.value))
148-
.map((option) => (
149-
<Badge
150-
color="secondary"
151-
key={option.value}
152-
className="rounded-sm px-1 font-normal"
153-
>
154-
{option.label}
155-
</Badge>
156-
))
157-
)}
131+
<div className="flex max-w-xs flex-wrap gap-1 py-4">
132+
{tags
133+
.filter((option) => selectedTags.includes(option.value))
134+
.map((option) => (
135+
<Badge
136+
color="secondary"
137+
key={option.value}
138+
className="rounded-sm px-1 font-normal"
139+
>
140+
{option.label}
141+
</Badge>
142+
))}
158143
</div>
159144
</>
160145
)}

0 commit comments

Comments
 (0)