mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-05 08:10:14 +00:00
Select top result by default
This commit is contained in:
parent
5974679aaf
commit
b9871310a4
1 changed files with 7 additions and 2 deletions
|
|
@ -206,8 +206,13 @@ const ChatTextArea = forwardRef<HTMLTextAreaElement, ChatTextAreaProps>(
|
|||
setShowContextMenu(showMenu)
|
||||
if (showMenu) {
|
||||
const lastAtIndex = newValue.lastIndexOf("@", newCursorPosition - 1)
|
||||
setSearchQuery(newValue.slice(lastAtIndex + 1, newCursorPosition))
|
||||
setSelectedMenuIndex(2) // Set to "File" option by default
|
||||
const query = newValue.slice(lastAtIndex + 1, newCursorPosition)
|
||||
setSearchQuery(query)
|
||||
if (query.length > 0) {
|
||||
setSelectedMenuIndex(0)
|
||||
} else {
|
||||
setSelectedMenuIndex(2) // Set to "File" option by default
|
||||
}
|
||||
} else {
|
||||
setSearchQuery("")
|
||||
setSelectedMenuIndex(-1)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue