Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: implement select mode menu autoscroll for long mode lists #1663

Merged
merged 2 commits into from
Feb 16, 2025

Conversation

FischLu
Copy link
Contributor

@FischLu FischLu commented Feb 14, 2025

#1586 中提到了模型 list 过长需要滚动显示菜单的问题, 这个 PR 完成了这个需求

@kangfenmao
Copy link
Collaborator

https://github.com/CherryHQ/cherry-studio/pull/1651/files

看看这个,两个哪个方案更好一些

@FischLu
Copy link
Contributor Author

FischLu commented Feb 14, 2025

基本逻辑都差不多, 另一个方案通过监听 selectedIndex 从而回调来滚动菜单, 我直接在 keydown 中滚动. 不过另一种方法使用了 menuElement.querySelector 来操作真实 dom, 这个在 react 中还是要尽量避免的

@kangfenmao kangfenmao merged commit b92b46f into CherryHQ:main Feb 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants