# project_panel: Fix dragged folders remaining highlighted even after the drag has ended \(\#64038\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/1a84d5d92bd7d6c1cabb116062650af545783fe9)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 1a84d5d92bd7d6c1cabb116062650af545783fe9

Requested commit: 1a84d5d92bd7d6c1cabb116062650af545783fe9

Commit: 1a84d5d92bd7d6c1cabb116062650af545783fe9

Tree: 1769848f558885ba727c523f030f6f14679cc9d5

Author: tidely

Committer: GitHub

## Message

```
project_panel: Fix dragged folders remaining highlighted even after the drag has ended (#64038)

# Objective

When dragging a folder outside of Zed, it is considered a platform drag,
instead of a GPUI native drag event. Currently when this platform drag
finishes, the selected folder remains highlighted, until unhighlighted
by initiating a GPUI native drag event.

Found this while testing #64033, I did not find an issue related to this
bug.

## Solution

- Clear the drag state when no gpui **or** platform drag event is
active.

## Testing

- Added asserts to relevant parts of previous tests
- Tested this locally

I can record a showcase if requested, skipping it for now since its
quite time consuming

## Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content adheres to Zed's UI standards
([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
and
[icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md)
guidelines)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- Fixed folders remaining highlighted even after dragging the folder has
stopped

---------

Co-authored-by: Kirill Bulatov <kirill@zed.dev>
```

## Parents

- [a57ba9b17c433ea1ebfdec8f649f4fa5a402d03b](https://git.cafe/gitcafe/zed/commit/a57ba9b17c433ea1ebfdec8f649f4fa5a402d03b?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/1a84d5d92bd7d6c1cabb116062650af545783fe9?format=markdown)
