Skip to content

Commit

Permalink
Add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
atmgrifter00 committed Feb 28, 2024
1 parent c6dfd60 commit aedd65e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/nimble-components/src/select/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -651,6 +651,8 @@ export class Select extends FormAssociatedSelect implements ErrorPattern {
}

public override selectNextOption(): void {
// don't call super.selectNextOption as that relies on side-effecty
// behavior to not select disabled option (which no longer works)
for (let i = this.selectedIndex + 1; i < this.options.length; i++) {
if (!this.options[i]?.disabled) {
this.selectedIndex = i;
Expand All @@ -660,6 +662,8 @@ export class Select extends FormAssociatedSelect implements ErrorPattern {
}

public override selectPreviousOption(): void {
// don't call super.selectPreviousOption as that relies on side-effecty
// behavior to not select disabled option (which no longer works)
for (let i = this.selectedIndex - 1; i >= 0; i--) {
if (!this.options[i]?.disabled) {
this.selectedIndex = i;
Expand Down

0 comments on commit aedd65e

Please sign in to comment.