# Pinegrow uncollapses entire tree view when editing code

**URL:** <https://forum.pinegrow.com/t/pinegrow-uncollapses-entire-tree-view-when-editing-code/6840>\
**Category:** Bug Reports\
**Tags:** bug, code, editor\
**Created:** [August 23, 2022, 2:40pm UTC](https://forum.pinegrow.com/t/pinegrow-uncollapses-entire-tree-view-when-editing-code/6840 "2022-08-23T14:40:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![adamslowe](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/adamslowe/32/4590_2.png) [@adamslowe](https://forum.pinegrow.com/u/adamslowe)\
**Post date:** [August 23, 2022, 2:40pm UTC](https://forum.pinegrow.com/t/pinegrow-uncollapses-entire-tree-view-when-editing-code/6840/1 "2022-08-23T14:40:00Z")

</div>

Hey guys,

I’m running up against an issue where, whenever I edit code and the code editor, it uncollapses everything in my tree view panel.

Here is a 45-second demo to show you what I mean.  
[  
Pinegrow uncollapsing tree view when code is edited directly - Watch Video  
  ![](https://cdn.loom.com/sessions/thumbnails/4dcef8b0717a4a188c9cc1a8666fb061-with-play.gif)](https://www.loom.com/share/4dcef8b0717a4a188c9cc1a8666fb061)

In a lot of cases, that’s not a big deal, but when I’m working on large documents, this gets to be a huge hassle as it slows down my productivity and makes navigating the code difficult. I know I can use the Element Code editor or the Element Properties panel, but sometimes just opening up the code editor is the fastest way to get something done.

If there’s anything that we can do to prevent this from automatically expanding. I would absolutely love that. Thank you.

---

<div class="post-metadata">

**Author:** ![matjaz](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/matjaz/32/5_2.png) [@matjaz](https://forum.pinegrow.com/u/matjaz)\
**Post date:** [August 23, 2022, 5:39pm UTC](https://forum.pinegrow.com/t/pinegrow-uncollapses-entire-tree-view-when-editing-code/6840/2 "2022-08-23T17:39:36Z")

</div>

@adamslowe yes, that’s not user friendly. I made a change that preserves the collapsed/expanded information in the code editor. One drawback is that `data-pg-collapsed` attributes are now visible in the code, but that’s just a cosmetic issue.
