Fix dumb bug with 'focusItemAtTop'

This commit is contained in:
Bryan Ashby 2022-08-06 00:43:26 -06:00
parent 695dc3944e
commit f3d0da2075
No known key found for this signature in database
GPG Key ID: C2C1B501E4EFD994
1 changed files with 2 additions and 2 deletions

View File

@ -50,7 +50,7 @@ function VerticalMenuView(options) {
this.updateViewVisibleItems = function () {
self.maxVisibleItems = Math.ceil(self.dimens.height / (self.itemSpacing + 1));
const topIndex = (this.focusItemAtTop ? throws.focusedItemIndex : 0) || 0;
const topIndex = (this.focusItemAtTop ? this.focusedItemIndex : 0) || 0;
self.viewWindow = {
top: topIndex,
@ -195,7 +195,7 @@ VerticalMenuView.prototype.setFocusItemIndex = function (index) {
? this.items.length - index
: this.items.length;
if (remainAfterFocus >= this.maxVisibleItems) {
const topIndex = (this.focusItemAtTop ? throws.focusedItemIndex : 0) || 0;
const topIndex = (this.focusItemAtTop ? this.focusedItemIndex : 0) || 0;
this.viewWindow = {
top: topIndex,