Skip to content

Commit 4665db7

Browse files
fix(AnalyticalTable): fix scrollbar issue on column reorder & initial horizontal scrolling (#413)
1 parent ece31fd commit 4665db7

File tree

4 files changed

+16
-14
lines changed

4 files changed

+16
-14
lines changed

.github/workflows/compressed-size.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,6 @@ jobs:
1313
- uses: preactjs/compressed-size-action@v1
1414
with:
1515
repo-token: '${{ secrets.GITHUB_TOKEN }}'
16-
pattern: 'lib/*.js'
16+
pattern: 'packages/**/lib/**/*.js'
17+
exlude: 'packages/**/src/lib/**'
1718
compression: 'gzip'

packages/main/src/components/AnalyticalTable/ColumnHeader/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ const styles = {
5959
position: 'relative',
6060
width: '100%',
6161
overflowX: 'hidden',
62-
padding: `0 0.5rem`
62+
padding: `0 0.5rem`,
63+
boxSizing: 'border-box'
6364
},
6465
iconContainer: {
6566
display: 'inline-block',

packages/main/src/components/AnalyticalTable/__snapshots__/AnalyticalTable.test.tsx.snap

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4902,7 +4902,7 @@ exports[`AnalyticalTable test drag and drop of a draggable column 1`] = `
49024902
style="position: absolute; left: 0px; top: 0px; height: 44px; width: 100%;"
49034903
>
49044904
<div
4905-
aria-colindex="1"
4905+
aria-colindex="2"
49064906
class="AnalyticalTable-tableCell-0"
49074907
role="cell"
49084908
style="position: absolute; top: 0px; left: 150px; width: 150px; align-items: center;"
@@ -4917,7 +4917,7 @@ exports[`AnalyticalTable test drag and drop of a draggable column 1`] = `
49174917
</span>
49184918
</div>
49194919
<div
4920-
aria-colindex="2"
4920+
aria-colindex="1"
49214921
class="AnalyticalTable-tableCell-0"
49224922
role="cell"
49234923
style="position: absolute; top: 0px; left: 0px; width: 150px; align-items: center;"
@@ -4969,7 +4969,7 @@ exports[`AnalyticalTable test drag and drop of a draggable column 1`] = `
49694969
style="position: absolute; left: 0px; top: 44px; height: 44px; width: 100%;"
49704970
>
49714971
<div
4972-
aria-colindex="1"
4972+
aria-colindex="2"
49734973
class="AnalyticalTable-tableCell-0"
49744974
role="cell"
49754975
style="position: absolute; top: 0px; left: 150px; width: 150px; align-items: center;"
@@ -4984,7 +4984,7 @@ exports[`AnalyticalTable test drag and drop of a draggable column 1`] = `
49844984
</span>
49854985
</div>
49864986
<div
4987-
aria-colindex="2"
4987+
aria-colindex="1"
49884988
class="AnalyticalTable-tableCell-0"
49894989
role="cell"
49904990
style="position: absolute; top: 0px; left: 0px; width: 150px; align-items: center;"
@@ -5036,14 +5036,14 @@ exports[`AnalyticalTable test drag and drop of a draggable column 1`] = `
50365036
style="position: absolute; left: 0px; top: 88px; height: 44px; width: 100%;"
50375037
>
50385038
<div
5039-
aria-colindex="1"
5039+
aria-colindex="2"
50405040
class="AnalyticalTable-tableCell-0"
50415041
role="cell"
50425042
style="position: absolute; top: 0px; left: 150px; width: 150px; align-items: center;"
50435043
tabindex="-1"
50445044
/>
50455045
<div
5046-
aria-colindex="2"
5046+
aria-colindex="1"
50475047
class="AnalyticalTable-tableCell-0"
50485048
role="cell"
50495049
style="position: absolute; top: 0px; left: 0px; width: 150px; align-items: center;"
@@ -5071,14 +5071,14 @@ exports[`AnalyticalTable test drag and drop of a draggable column 1`] = `
50715071
style="position: absolute; left: 0px; top: 132px; height: 44px; width: 100%;"
50725072
>
50735073
<div
5074-
aria-colindex="1"
5074+
aria-colindex="2"
50755075
class="AnalyticalTable-tableCell-0"
50765076
role="cell"
50775077
style="position: absolute; top: 0px; left: 150px; width: 150px; align-items: center;"
50785078
tabindex="-1"
50795079
/>
50805080
<div
5081-
aria-colindex="2"
5081+
aria-colindex="1"
50825082
class="AnalyticalTable-tableCell-0"
50835083
role="cell"
50845084
style="position: absolute; top: 0px; left: 0px; width: 150px; align-items: center;"
@@ -5106,14 +5106,14 @@ exports[`AnalyticalTable test drag and drop of a draggable column 1`] = `
51065106
style="position: absolute; left: 0px; top: 176px; height: 44px; width: 100%;"
51075107
>
51085108
<div
5109-
aria-colindex="1"
5109+
aria-colindex="2"
51105110
class="AnalyticalTable-tableCell-0"
51115111
role="cell"
51125112
style="position: absolute; top: 0px; left: 150px; width: 150px; align-items: center;"
51135113
tabindex="-1"
51145114
/>
51155115
<div
5116-
aria-colindex="2"
5116+
aria-colindex="1"
51175117
class="AnalyticalTable-tableCell-0"
51185118
role="cell"
51195119
style="position: absolute; top: 0px; left: 0px; width: 150px; align-items: center;"

packages/main/src/components/AnalyticalTable/hooks/useTableCellStyling.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import { VerticalAlign } from '@ui5/webcomponents-react/lib/VerticalAlign';
44
import { CSSProperties } from 'react';
55

66
const getCellProps = (cellProps, { cell: { column }, instance }) => {
7-
const lastColumnId = instance.columns[instance.columns.length - 1]?.id;
8-
const columnIndex = instance.columns.findIndex(({ id }) => id === column.id);
7+
const lastColumnId = instance.visibleColumns[instance.visibleColumns.length - 1]?.id;
8+
const columnIndex = instance.visibleColumns.findIndex(({ id }) => id === column.id);
99
const { classes } = instance.webComponentsReactProperties;
1010
const style: CSSProperties = {};
1111

0 commit comments

Comments
 (0)