Disable remove button only when it's the last field (#3136)

This commit is contained in:
Erik Jan de Wit 2022-08-22 17:59:35 +02:00 committed by GitHub
parent 3e08fbaa4b
commit a1140191d6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -64,7 +64,7 @@ export const MultiLineInput = ({
onClick={() => remove(index)} onClick={() => remove(index)}
tabIndex={-1} tabIndex={-1}
aria-label={t("common:remove")} aria-label={t("common:remove")}
isDisabled={index === 0} isDisabled={fields.length === 1}
> >
<MinusCircleIcon /> <MinusCircleIcon />
</Button> </Button>