From ba5ef4eb3b5d158f4285821d77515a8a032b7813 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yi=C4=9Fit=20FINDIKLI?= Date: Fri, 4 Jun 2021 17:14:06 +0300 Subject: [PATCH] Fixed #10252 - Dropdown selecting disabled option throws error using keyboard arro --- src/app/components/dropdown/dropdown.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/components/dropdown/dropdown.ts b/src/app/components/dropdown/dropdown.ts index bf57463f0d8..405ccca4f49 100755 --- a/src/app/components/dropdown/dropdown.ts +++ b/src/app/components/dropdown/dropdown.ts @@ -803,7 +803,7 @@ export class Dropdown implements OnInit,AfterViewInit,AfterContentInit,AfterView let nextEnabledOption; if (this.optionsToDisplay && this.optionsToDisplay.length) { - for (let i = (index + 1); index < (this.optionsToDisplay.length - 1); i++) { + for (let i = (index + 1); i < (this.optionsToDisplay.length - 1); i++) { let option = this.optionsToDisplay[i]; if (this.isOptionDisabled(option)) { continue; @@ -845,7 +845,7 @@ export class Dropdown implements OnInit,AfterViewInit,AfterContentInit,AfterView else { if (this.group) { let selectedItemIndex = this.selectedOption ? this.findOptionGroupIndex(this.getOptionValue(this.selectedOption), this.optionsToDisplay) : -1; - + if (selectedItemIndex !== -1) { let nextItemIndex = selectedItemIndex.itemIndex + 1; if (nextItemIndex < (this.getOptionGroupChildren(this.optionsToDisplay[selectedItemIndex.groupIndex]).length)) {