mirror of
https://github.com/wassname/nvatom.git
synced 2026-06-27 16:10:36 +08:00
Make the first found item to be automatically selected
This is a regression caused by docquery integration (56821bccbc). indexof always returns -1. Since the selected item is always the first filtered item, we can safely set it to 1.
This commit is contained in:
@@ -136,8 +136,7 @@ class NotationalVelocityView extends SelectListView
|
||||
@list.append(itemView)
|
||||
|
||||
if selectedItem
|
||||
n = filteredItems.indexOf(selectedItem) + 1
|
||||
@selectItemView(@list.find("li:nth-child(#{n})"))
|
||||
@selectItemView(@list.find("li:nth-child(#{1})"))
|
||||
|
||||
else
|
||||
@setError(@getEmptyMessage(@docQuery.documents.length, filteredItems.length))
|
||||
|
||||
Reference in New Issue
Block a user