Skip to content

Commit 9b3d2bb

Browse files
milan-wCopilot
andauthored
fix: Apply minor suggestions from code review
Co-authored-by: Copilot <[email protected]>
1 parent fcdd29d commit 9b3d2bb

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

packages/components/src/components/tab-item/tab-item.lite.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ export default function DBTabItem(props: DBTabItemProps) {
129129
}, [props.name]);
130130

131131
onUnMount(() => {
132-
if (state._listenerAdded && _ref) {
132+
if (state._listenerAdded && _ref && state.boundSetSelectedOnChange) {
133133
_ref.closest('[role=tablist]')?.removeEventListener(
134134
'change',
135135
state.boundSetSelectedOnChange

packages/components/src/components/tabs/tabs.spec.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { DBTabList } from '../tab-list';
99
import { DBTabPanel } from '../tab-panel';
1010

1111
let tabIndex: number | undefined;
12-
let comp: any;
12+
let comp: any = null;
1313

1414
test.beforeEach(() => {
1515
tabIndex = undefined;

0 commit comments

Comments
 (0)