From 974222739745e1a8c082ed77e3e68199907f7890 Mon Sep 17 00:00:00 2001 From: Sorin Sarca Date: Fri, 17 Dec 2021 04:34:12 +0200 Subject: [PATCH] fix(tabs): error on click - undefined tab target --- packages/tabs/src/Tabs.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/tabs/src/Tabs.ts b/packages/tabs/src/Tabs.ts index 502c5658ca..59af6af789 100644 --- a/packages/tabs/src/Tabs.ts +++ b/packages/tabs/src/Tabs.ts @@ -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;