From 18310cca372f309c543bde77dcebbb0766018efb Mon Sep 17 00:00:00 2001 From: Maximilian Franzke Date: Tue, 23 Apr 2024 09:06:20 +0200 Subject: [PATCH 1/3] refactor: this attribute is redundant --- packages/components/src/components/tab-item/tab-item.lite.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/components/src/components/tab-item/tab-item.lite.tsx b/packages/components/src/components/tab-item/tab-item.lite.tsx index 461523cf621..aaa12c9a370 100644 --- a/packages/components/src/components/tab-item/tab-item.lite.tsx +++ b/packages/components/src/components/tab-item/tab-item.lite.tsx @@ -45,7 +45,6 @@ export default function DBTabItem(props: DBTabItemProps) { disabled={props.disabled} ref={ref} type="radio" - role="tab" id={state._id} /> From 4b2f0bc03cfe22948a39a592f5d9cc9abee0c07b Mon Sep 17 00:00:00 2001 From: Maximilian Franzke Date: Tue, 23 Apr 2024 09:09:47 +0200 Subject: [PATCH 2/3] refactor: optimized script and roles defintions --- .../src/components/tab-list/tab-list.lite.tsx | 5 ++--- .../components/src/components/tabs/tabs.lite.tsx | 13 +++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/components/src/components/tab-list/tab-list.lite.tsx b/packages/components/src/components/tab-list/tab-list.lite.tsx index 4476900cee5..165a05fa9cd 100644 --- a/packages/components/src/components/tab-list/tab-list.lite.tsx +++ b/packages/components/src/components/tab-list/tab-list.lite.tsx @@ -24,9 +24,8 @@ export default function DBTabList(props: DBTabListProps) {
-
    {props.children}
+ class={cls('db-tab-list', props.className)}> +
    {props.children}
); } diff --git a/packages/components/src/components/tabs/tabs.lite.tsx b/packages/components/src/components/tabs/tabs.lite.tsx index 41d5c5ea05e..96ff81e6a43 100644 --- a/packages/components/src/components/tabs/tabs.lite.tsx +++ b/packages/components/src/components/tabs/tabs.lite.tsx @@ -65,7 +65,9 @@ export default function DBTabs(props: DBTabsProps) { if (ref) { const childTabLists = ref.getElementsByClassName('db-tab-list'); if (childTabLists?.length > 0) { - const firstTabList = childTabLists.item(0); + const firstTabList = childTabLists + .item(0) + .querySelector('ul'); if (firstTabList) { if ( !firstTabList @@ -79,11 +81,10 @@ export default function DBTabs(props: DBTabsProps) { } if (props.behaviour === 'arrows') { - const container = firstTabList.querySelector('ul'); - state.scrollContainer = container; - state.evaluateScrollButtons(container); - container.addEventListener('scroll', () => { - state.evaluateScrollButtons(container); + state.scrollContainer = firstTabList; + state.evaluateScrollButtons(firstTabList); + firstTabList.addEventListener('scroll', () => { + state.evaluateScrollButtons(firstTabList); }); } } From 2d32e39ba5c0aebf140cba4442e2220d149e6a7d Mon Sep 17 00:00:00 2001 From: Maximilian Franzke Date: Tue, 23 Apr 2024 09:11:03 +0200 Subject: [PATCH 3/3] refactor: use the accepted HTML tag section over article, as article couldn't accept a role="tabpanel" --- .../components/src/components/tab-panel/tab-panel.lite.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/components/src/components/tab-panel/tab-panel.lite.tsx b/packages/components/src/components/tab-panel/tab-panel.lite.tsx index f599180c5ff..5838055de8a 100644 --- a/packages/components/src/components/tab-panel/tab-panel.lite.tsx +++ b/packages/components/src/components/tab-panel/tab-panel.lite.tsx @@ -25,13 +25,13 @@ export default function DBTabPanel(props: DBTabPanelProps) { // jscpd:ignore-end return ( -
{props.content} {props.children} -
+ ); }