# Bug OP-20868 - Inline edit field stays blank when its editor throws while rendering

Project: OpenProject
Status: confirmed
URL: https://community.openproject.org/work_packages/OP-20868

## Open points

_No work packages_

## Details

| Attribute | Value |
| --- | --- |
| Date |  |
| Priority | Medium |
| Module | Frontend components and Primer design system |
| Target versions | Product Backlog |
| Observed in versions | 18.1.0 |
| Sprint |  |
| Backlog bucket |  |
| Bug found in version (deprecated) |  |
| Found in mobile app version |  |
| Follow-up feedback e-mail |  |
| Requires doc change | No |
| Accessibility | No |
| Pull preview |  |
| List |  |
| Labels |  |

## People

| Attribute | Value |
| --- | --- |
| Assignee |  |
| Accountable |  |
| Product manager |  |
| Developers |  |
| Designer |  |
| Ordered by |  |
| Signed off by |  |
| Interest by |  |

## Planning

| Attribute | Value |
| --- | --- |
| Relevance |  |

## Costs

| Attribute | Value |
| --- | --- |
| Votes |  |
| Work |  |
| Labor costs |  |

## Description

### Before filing a report

Found during review of <https://github.com/opf/openproject/pull/27321> (<mention class="mention" data-id="OP-20797" data-type="work_package" data-text="#OP-20797">#OP-20797</mention>), which handles editors that fail after they are attached. Traced in the code on `dev`; not reproduced in a browser.

### Steps to reproduce

1.  Have an inline edit field whose editor component throws while it first renders, for example a `TypeError` in its `ngOnInit` caused by unexpected schema data.
2.  Activate the field, by clicking it in the work package view or in a table cell, or with access key 3 for the subject.

### What is the buggy behavior?

The field's display is hidden and no editor appears. The field stays blank until the page is reloaded, and activating it again does nothing.

`EditingPortalService.create()` attaches the editing portal and waits for `onEditFieldReady`, which `EditFormPortalComponent` emits from `ngAfterViewInit`. The first render runs in a later application tick, so an error thrown there goes to Angular's `ErrorHandler`. `ngAfterViewInit` never runs, the readiness promise never settles, and the recovery that restores the field's display on failure never runs.

### What is the expected behavior?

The field returns to its display, the error is reported, and activating the field again tries again.

A possible approach is to run the portal's first change detection inside `create()`, so a render error throws inside the existing error handling. This changes when every inline editor first renders (table cells, split and full view, custom field modals, CKEditor fields), so it needs browser checks of these.

### **Logs**

None.

### Screenshots and other files

None.

### Environment information

**OpenProject version**

`dev`, code inspection.

**Browser**

- [ ] Chrome
- [ ] Firefox
- [ ] Safari

**Language**

n/a
