message: fix: allow to select values without respect of current select
diff: @@ -47,9 +47,19 @@ async function selectMultipleEntities(props: {
  entityType: EntityType;
  validations: ReferenceValidations;
  }) {
  + const value = props.sdk.field.getValue();
  +
  + const linkCount = Array.isArray(value) ? value.length : value ? 1 : 0;
  +
  + // TODO: Why not always set `min: 1` by default? Does it make sense to enforce
  + // user to select as many entities as the field's "min" requires? What if e.g.
  + // "min" is 4 and the user wants to insert 2 entities first, then create 2 new ones?
  + const min = Math.max((props.validations.numberOfLinks?.min || 1) - linkCount, 1);
  + // TODO: Consider same for max. If e.g. "max" is 4, we disable the button if the
  + // user wants to select 5 but we show no information why the button is disabled.
  + const max = (props.validations.numberOfLinks?.max || +Infinity) - linkCount;
  +
  if (props.entityType === 'Entry') {
  - const min = props.validations.numberOfLinks?.min;
  - const max = props.validations.numberOfLinks?.max;
  return await props.sdk.dialogs.selectMultipleEntries<Entry>({
  locale: props.sdk.field.locale,
  contentTypes: props.validations.contentTypes,
  @@ -59,7 +69,9 @@ async function selectMultipleEntities(props: {
  } else {
  return props.sdk.dialogs.selectMultipleAssets<Asset>({
  locale: props.sdk.field.locale,
  - mimetypeGroups: props.validations.mimetypeGroups
  + mimetypeGroups: props.validations.mimetypeGroups,
  + min,
  + max
  });
  }
  }
  