Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AnalyticalTable | @ui5/webcomponents-react | 2.7.1 | typescript]: #7072

Open
1 task done
clevianerebeca-silva opened this issue Mar 12, 2025 · 2 comments
Open
1 task done

Comments

@clevianerebeca-silva
Copy link

clevianerebeca-silva commented Mar 12, 2025

Bug Description

AnalyticalTable columns with minWidth are causing an unnecessary overflow

Affected Component

AnalyticalTable

Expected Behaviour

When we set minWidths for all columns and the table size is bigger than the sum of the minWidths, no overflow should happen.

Isolated Example

https://stackblitz.com/edit/github-thk7nci8-znb8zkpk?file=src%2FApp.tsx

Steps to Reproduce

  1. Use the AnalyticalTable component
  2. Add minWidth for all columns
  3. Check it on a screen bigger than the sum of minWidths
    ...

Log Output, Stack Trace or Screenshots

Our AnalyticalTable usage:

<AnalyticalTable
      columns={columns}
      data={tableData ?? []}
      sortable
      filterable
      isTreeTable={!!groupBy}
      {...(!!groupBy && { groupBy: [groupBy] })}
      minRows={1}
      globalFilterValue={searchTerm}
      noDataText={t('myProcessOverview.tableNoDataText')}
      {...(loading && {
        NoDataComponent: () => (
          <div className={style.dataLoading}>
            <BusyIndicator active delay={0} />
          </div>
        ),
      })}
      reactTableOptions={{
        initialState: {
          sortBy: [{ id: initialSortById, desc: initialSortByDesc }],
        },
      }}
      onRowClick={onRowClick}
/>

Columns definition:

 const columns = [
    createTextColumn({
      accessor: 'model.name',
      header: t('myProcessOverview.tableNameHeader'),
      object: 'Process Model',
      isBold: true,
      minWidth: 425,
      onTextClick: (e, row) => {
        e.stopPropagation()
        const { __typename, id } = row.model
        const url = getUrl({ __typename, id, excludeBasePath: true })
        url && navigate(url)
      },
    }),
    createTextColumn({
      accessor: 'model.type',
      header: t('myProcessOverview.tableTypeHeader'),
      minWidth: 130,
    }),
    createTextColumn({
      accessor: 'model.description',
      header: t('myProcessOverview.tableDescriptionHeader'),
      minWidth: 130,
    }),
    createChipColumn({
      accessor: 'relatedRoleTitles',
      header: t('myProcessOverview.tableMyRoleHeader'),
      filterableValues: availableRoles,
      design: 'indication5',
      minWidth: 300,
    }),
  ]
Screen.Recording.2025-03-12.at.16.49.23.mov

As you can see in the video, the table is 1197px wide, while the sum of the minWidths is 985px. Since there is available space, the horizontal scroll shouldn't appear. We also tried with scaleWidthMode as Grow and Smart but the overflow also happens in both cases.

Priority

Low

UI5 Web Components Version

2.7.1

Browser

Chrome

Operating System

No response

Additional Context

No response

Organization

No response

Declaration

  • I’m not disclosing any internal or sensitive information.
@nnaydenow nnaydenow transferred this issue from SAP/ui5-webcomponents Mar 13, 2025
@nnaydenow
Copy link

nnaydenow commented Mar 13, 2025

Hi @Lukas742, @MarcusNotheis,

The issue is related to AnalyticalTable so I'm forwarding it to ui5-webcomponents-react project.


Hi @clevianerebeca-silva,
Could you please provide an example where colleagues could debug it because I've tried to reproduce it without success:
https://stackblitz.com/edit/github-thk7nci8?file=package.json

@clevianerebeca-silva
Copy link
Author

clevianerebeca-silva commented Mar 13, 2025

hey @nnaydenow here is: https://stackblitz.com/edit/github-thk7nci8-znb8zkpk?file=src%2FApp.tsx. I basically set a higher minWidth for the first and last columns. Check it on a large screen that is wider than the sum of the minWidths, and you'll see that the horizontal scroll appears

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🆕 New
Development

No branches or pull requests

3 participants