Only show list item add instructions when allowed

This commit is contained in:
april 2024-01-15 17:01:06 -06:00
parent 9a16d79ab9
commit c483cf6dc6
2 changed files with 5 additions and 2 deletions

View File

@ -44,7 +44,7 @@ export default function ListInput({
<PillsInput <PillsInput
mt={mt} mt={mt}
label={label} label={label}
description="Press enter or comma to add item" description={canAdd ? "Press enter or comma to add item" : ""}
> >
<Pill.Group> <Pill.Group>
{(form.getTransformedValues()[field_key] as string[]).map( {(form.getTransformedValues()[field_key] as string[]).map(

View File

@ -31,7 +31,10 @@ export default function ListInput({
}; };
return ( return (
<PillsInput label={label} description="Press enter or comma to add item"> <PillsInput
label={label}
description={canAdd ? "Press enter or comma to add item" : ""}
>
<Pill.Group> <Pill.Group>
{value.map((item: string) => ( {value.map((item: string) => (
<Pill <Pill