UI Kit2 custom field on transition screen submits on blur

I have a Forge app that provides a custom field using UI Kit2.

  jira:customField:
    - key: cf-attachment
      name: Attachment Selector
      description: Attachment selector custom field
      type: string
      collection: list
      resource: view-field
      render: native
      edit:
        resource: edit-field
        render: native
        isInline: true
      resolver:
        function: resolver

When I create a new issue, I can see that the value of the custom field is submitted when the issue is created, i.e. the onSubmit function of the CustomFieldEdit component is not called until you hit “Create”.

However, in the new issue transition experience when placing the custom field on a transition screen, the value of the custom field is submitted on blur, i.e. every time the field loses focus.

This presents me with two problems:

  1. The user will be confused if they cancel the transition but the value of the custom field has in fact changed, even though they never submitted the transition screen
  2. I need to perform a final action when the transition screen is submitted

I have tried disableSubmitOnBlur on the CustomFieldEdit component, but when I do that, then onSubmit is never called and the transition screen never closes,

1 Like

Note that I have already tried using a cleanup function (i.e. a function returned by the useEffect hook), which does not appear to be supported in UI Kit2, i.e. the function never gets called.

1 Like

Submit a dev support ticket. It’s very likely a bug they’ve overlooked.

I discovered ~7 major flaws during the recent UI Kit 1 forced migration. Still waiting on those tickets to be drawn up.

Similar things in Confluence like macro config sidebar being re-rendered on field blur. And ForgeReconciler.addConfig() component is run on every page view regardless of whether a macro is being edited/configured.

1 Like