# assistant: Preserve selection focus in the model selector \(\#23713\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 98ea0587dfd39bb1f5cbe190f2b61c9c50286c8b

Requested commit: 98ea0587dfd39bb1f5cbe190f2b61c9c50286c8b

Commit: 98ea0587dfd39bb1f5cbe190f2b61c9c50286c8b

Tree: 9f744fec899476d4990aa8c0787f21573f9371e0

Author: Danilo Leal

Committer: GitHub

## Message

```
assistant: Preserve selection focus in the model selector (#23713)

This PR fixes an incorrect behavior in the model selector where we were
removing the focus from the selected item back to the very first item of
the list. Now, if you click/hit return on an item, focus is preserved
there. In other words, focus is always initially in the selected item.

### Before

https://github.com/user-attachments/assets/62b72b1f-4e32-4b4a-adff-dcf9a2c13a28

### After

https://github.com/user-attachments/assets/a8528933-da01-481a-96f3-0173a39a03c0

Release Notes:

- N/A
```

## Parents

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

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