Skip to content

Commit

Permalink
fix(tabs): error on click - undefined tab target
Browse files Browse the repository at this point in the history
  • Loading branch information
sorinsarca authored and Westbrook committed Jan 8, 2022
1 parent 5ad16bd commit 9742227
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/tabs/src/Tabs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -269,10 +269,13 @@ export class Tabs extends SizedMixin(Focusable) {
}

private onClick = (event: Event): void => {
if (this.disabled) {
return;
}
const target = event
.composedPath()
.find((el) => (el as Tab).parentElement === this) as Tab;
if (this.disabled || target.disabled) {
if (!target || target.disabled) {
return;
}
this.shouldAnimate = true;
Expand Down

0 comments on commit 9742227

Please sign in to comment.