Skip to content

Commit

Permalink
perf: simplify focus management logic in AuroCounterGroup component #195
Browse files Browse the repository at this point in the history
  • Loading branch information
rmenner committed Feb 5, 2025
1 parent cc83bc5 commit 331813a
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions components/counter/src/auro-counter-group.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* eslint-disable lit/no-invalid-html, lit/binding-positions, max-lines, prefer-destructuring, no-underscore-dangle, no-lonely-if */
/* eslint-disable lit/no-invalid-html, lit/binding-positions, max-lines, prefer-destructuring, no-underscore-dangle */

// Copyright (c) 2025 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
// See LICENSE in the project root for license information.
Expand Down Expand Up @@ -162,12 +162,10 @@ export class AuroCounterGroup extends LitElement {
} else {
counters[currentIndex - 1].focus();
}
} else if (currentIndex === counters.length - 1) {
firstFocusable.focus();
} else {
if (currentIndex === counters.length - 1) {
firstFocusable.focus();
} else {
counters[currentIndex + 1].focus();
}
counters[currentIndex + 1].focus();
}

}
Expand Down

0 comments on commit 331813a

Please sign in to comment.