From aedd65e835fdc59bda5c9f500abd60e2a0e01931 Mon Sep 17 00:00:00 2001 From: Jonathan Meyer <26874831+atmgrifter00@users.noreply.github.com> Date: Wed, 28 Feb 2024 15:08:23 -0600 Subject: [PATCH] Add comments --- packages/nimble-components/src/select/index.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/nimble-components/src/select/index.ts b/packages/nimble-components/src/select/index.ts index b107a5dee5..0230797ef3 100644 --- a/packages/nimble-components/src/select/index.ts +++ b/packages/nimble-components/src/select/index.ts @@ -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; @@ -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;