Skip to content

Commit 62dea66

Browse files
Remove optional chaining.
1 parent 6e04b27 commit 62dea66

File tree

1 file changed

+4
-4
lines changed
  • packages/web-components/fast-foundation/src/toolbar

1 file changed

+4
-4
lines changed

packages/web-components/fast-foundation/src/toolbar/toolbar.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ export class Toolbar extends FoundationElement {
7676

7777
set activeIndex(value: number) {
7878
if (this.$fastController.isConnected) {
79-
this._activeIndex = limit(0, this.focusableElements?.length > 0 ? this.focusableElements.length - 1 : 0, value);
79+
this._activeIndex = limit(0, this.focusableElements.length > 0 ? this.focusableElements.length - 1 : 0, value);
8080
Observable.notify(this, "activeIndex");
8181
}
8282
}
@@ -206,7 +206,7 @@ export class Toolbar extends FoundationElement {
206206
}
207207

208208
const nextIndex = this.activeIndex + incrementer;
209-
if (this.focusableElements?.length > 0 && this.focusableElements[nextIndex]) {
209+
if (this.focusableElements.length > 0 && this.focusableElements[nextIndex]) {
210210
e.preventDefault();
211211
}
212212

@@ -260,7 +260,7 @@ export class Toolbar extends FoundationElement {
260260
this.activeIndex = activeIndex;
261261
this.setFocusableElements();
262262
if (
263-
this.focusableElements?.length > 0 &&
263+
this.focusableElements.length > 0 &&
264264
this.focusableElements[this.activeIndex] &&
265265
// Don't focus the toolbar element if some event handlers moved
266266
// the focus on another element in the page.
@@ -314,7 +314,7 @@ export class Toolbar extends FoundationElement {
314314
* @internal
315315
*/
316316
private setFocusableElements(): void {
317-
if (this.$fastController.isConnected && this.focusableElements?.length > 0) {
317+
if (this.$fastController.isConnected && this.focusableElements.length > 0) {
318318
this.focusableElements.forEach((element, index) => {
319319
element.tabIndex = this.activeIndex === index ? 0 : -1;
320320
});

0 commit comments

Comments
 (0)