Skip to content

Commit

Permalink
Scroll the list to the exact match if there is one.
Browse files Browse the repository at this point in the history
  • Loading branch information
hernanmd committed Sep 24, 2024
1 parent 2635cd9 commit 934e121
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/NewTools-Core/StBrowserSearchPresenter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -219,13 +219,17 @@ StBrowserSearchPresenter >> selectedItems [
{ #category : 'updating' }
StBrowserSearchPresenter >> updateList [

| newItems |
| newItems env |

env := self class environment.
newItems := searchField text
ifEmpty: [ items ]
ifNotEmpty: [ :text | self search: text ].

itemsList items = newItems ifFalse: [
itemsList
items: newItems;
selectFirst ]
itemsList items: newItems ].

(env hasClassNamed: searchField text)
ifTrue: [ itemsList selectItem: (env at: searchField text asSymbol) scrollToSelection: true ]
ifFalse: [ itemsList selectFirst ]
]

0 comments on commit 934e121

Please sign in to comment.