Custom Field module does not accept strings in Text components

TLDR: I think the custom field module (or forge-ui component) is broken as it can not render Text components with strings in them.

Hi,

I’m trying to build a Forge app that provides a custom field. A couple months ago, we had this working but hit another roadblock, then I recently updated all packages and now the custom field isn’t working anymore.

I’ve been able to distill this bug into an example repo. It’s basically the custom field template, but with Typescript.

The original code is JSX and still works:

<CustomField>
  <Text content={`Hello ${fieldValue || "world"}!`}/>
</CustomField>

However, the content property seems to be gone from UI kit’s Text component, according to the docs. It’s also gone from the types, as can be witnessed by converting the example to Typescript:

When I then fix it to the “new style” of Text component, it breaks when trying to render it:

<CustomField>
  <Text>
    Hello {fieldValue || "world"}!
  </Text>
</CustomField>

This causes Jira to render an error:

(There are less of these lines if you only use a simple string, like “hi”).

I’ve put the distilled example into a repo so you can try and reproduce the issue. You can find it at https://bitbucket.org/resolutiongmbh/forge-broken-custom-field/src/main/.

As I’ve mentioned before, this used to work with older versions of forge-ui (I think), the one where I can confirm this working was 0.7.0 according to our version control. I’m not saying it broke with whatever came next, I’m saying it broke since then.

Thanks in advance for looking into this :slight_smile:

1 Like

Hello, @tobitheo,

We are aware of this issue and are working on a fix. We’ll keep you posted.

1 Like