Skip to content

Commit

Permalink
Fixed #10252 - Dropdown selecting disabled option throws error using …
Browse files Browse the repository at this point in the history
…keyboard arro
  • Loading branch information
yigitfindikli committed Jun 4, 2021
1 parent 3f405d7 commit ba5ef4e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/app/components/dropdown/dropdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)) {
Expand Down

0 comments on commit ba5ef4e

Please sign in to comment.