# Bug DREAM-540 - Form state is not initialized when rendering a tree view with already selected items

Project: Stream Design System
Status: closed
URL: https://community.openproject.org/work_packages/DREAM-540

## Open points

_No work packages_

## Details

| Attribute | Value |
| --- | --- |
| Date |  |
| Priority | High |
| Module | Frontend components and Primer design system |
| Target versions | 17.0.0 |
| Observed in versions | 16.6.0 |
| Sprint |  |
| Backlog bucket |  |
| Bug found in version (deprecated) | 16.6.x |
| Requires doc change | No |
| Accessibility | No |
| Pull preview |  |
| List |  |
| Labels |  |

## People

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

## Planning

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

## Costs

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

## Description

### Steps to reproduce

1.  As a user with permission to change project attributes.
    
2.  Go to a project that has a project attribute of type hierarchy.
    
3.  Go to project home and set some values to the project attribute
    
4.  Open the dialog again by clicking on the attribute value field.
    
5.  Click on save directly.
    

### What is the buggy behavior?

*   The attribute value is removed.
    

### What is the expected behavior?

1.  The attribute value should remain the same, as the items are still selected in the dialog and the user pressed saved.&nbsp;
    

### Important note

*   This happens, because the form is submitted, as if there would be NO item selected. Thus, the controller behaves correctly and removes the values. By executing a noop operation in the tree view - e.g. selecting and deselecting any other item - the form value is set correctly.
