From 3effbe6991007cb691543fe9c4f51e978e20963a Mon Sep 17 00:00:00 2001 From: Chris-MS-896 <64865559+Chris-MS-896@users.noreply.github.com> Date: Tue, 12 Jan 2021 13:09:20 -0600 Subject: [PATCH] no message (#372) --- src/Explorer/Tree/AccessibleVerticalList.ts | 10 +++++++--- tsconfig.strict.json | 1 + 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/Explorer/Tree/AccessibleVerticalList.ts b/src/Explorer/Tree/AccessibleVerticalList.ts index 818328a41..96db22df8 100644 --- a/src/Explorer/Tree/AccessibleVerticalList.ts +++ b/src/Explorer/Tree/AccessibleVerticalList.ts @@ -8,7 +8,7 @@ enum ScrollPosition { export class AccessibleVerticalList { private items: any[] = []; - private onSelect: (item: any) => void; + private onSelect?: (item: any) => void; public currentItemIndex: ko.Observable; public currentItem: ko.Computed; @@ -42,7 +42,9 @@ export class AccessibleVerticalList { const targetElement = targetContainer .getElementsByClassName("accessibleListElement") .item(this.currentItemIndex()); - this.scrollElementIntoContainerViewIfNeeded(targetElement, targetContainer, ScrollPosition.Top); + if (targetElement) { + this.scrollElementIntoContainerViewIfNeeded(targetElement, targetContainer, ScrollPosition.Top); + } return false; } if (event.keyCode === 40) { @@ -52,7 +54,9 @@ export class AccessibleVerticalList { const targetElement = targetContainer .getElementsByClassName("accessibleListElement") .item(this.currentItemIndex()); - this.scrollElementIntoContainerViewIfNeeded(targetElement, targetContainer, ScrollPosition.Bottom); + if (targetElement) { + this.scrollElementIntoContainerViewIfNeeded(targetElement, targetContainer, ScrollPosition.Top); + } return false; } return true; diff --git a/tsconfig.strict.json b/tsconfig.strict.json index 8b947e2c4..2a7da5bcd 100644 --- a/tsconfig.strict.json +++ b/tsconfig.strict.json @@ -59,6 +59,7 @@ "./src/Explorer/Notebook/NotebookComponent/types.ts", "./src/Explorer/Notebook/NotebookContentItem.ts", "./src/Explorer/Notebook/NotebookUtil.ts", + "./src/Explorer/Tree/AccessibleVerticalList.ts", "./src/Explorer/Panes/PaneComponents.ts", "./src/Explorer/Panes/Tables/Validators/EntityPropertyNameValidator.ts", "./src/Explorer/Panes/Tables/Validators/EntityPropertyValidationCommon.ts",