Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ export class ActionMenu implements LoadableComponent {
async setFocus(): Promise<void> {
await componentFocusable(this);

focusElement(this.menuButtonEl);
return focusElement(this.menuButtonEl);
}

// --------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion packages/calcite-components/src/components/alert/alert.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ export class Alert implements OpenCloseComponent, LoadableComponent, T9nComponen
if (!this.closeButton && !alertLinkEl) {
return;
} else if (alertLinkEl) {
alertLinkEl.setFocus();
return alertLinkEl.setFocus();
} else if (this.closeButton) {
this.closeButton.focus();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ export class ChipGroup implements InteractiveComponent {
async setFocus(): Promise<void> {
await componentFocusable(this);
if (!this.disabled) {
(this.selectedItems[0] || this.items[0])?.setFocus();
return (this.selectedItems[0] || this.items[0])?.setFocus();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ export class ColorPickerHexInput implements LoadableComponent {
async setFocus(): Promise<void> {
await componentFocusable(this);

focusElement(this.hexInputNode);
return focusElement(this.hexInputNode);
}

//--------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion packages/calcite-components/src/components/list/list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ export class List implements InteractiveComponent, LoadableComponent {
@Method()
async setFocus(): Promise<void> {
await componentFocusable(this);
this.enabledListItems.find((listItem) => listItem.active)?.setFocus();
return this.enabledListItems.find((listItem) => listItem.active)?.setFocus();
}

// --------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export class CalciteNavigation implements LoadableComponent {
@Method()
async setFocus(): Promise<void> {
await componentFocusable(this);
await this.navigationActionEl?.setFocus();
return this.navigationActionEl?.setFocus();
}

//--------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ export class Notice
return;
}
if (noticeLinkEl) {
noticeLinkEl.setFocus();
return noticeLinkEl.setFocus();
} else if (this.closeButton) {
this.closeButton.focus();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,10 @@ export class RadioButtonGroup implements LoadableComponent {
async setFocus(): Promise<void> {
await componentFocusable(this);
if (this.selectedItem && !this.selectedItem.disabled) {
this.selectedItem.setFocus();
return;
return this.selectedItem.setFocus();
}
if (this.radioButtons.length > 0) {
this.getFocusableRadioButton()?.setFocus();
return this.getFocusableRadioButton()?.setFocus();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ export class TileSelect implements InteractiveComponent, LoadableComponent {
async setFocus(): Promise<void> {
await componentFocusable(this);

this.input?.setFocus();
return this.input?.setFocus();
}

//--------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ export class ValueListItem
async setFocus(): Promise<void> {
await componentFocusable(this);

this.pickListItem?.setFocus();
return this.pickListItem?.setFocus();
}

// --------------------------------------------------------------------------
Expand Down