SAP / ui5-webcomponents

UI5 Web Components - the enterprise-flavored sugar on top of native APIs! Build SAP Fiori user interfaces with the technology of your choice.
https://sap.github.io/ui5-webcomponents/
Apache License 2.0
1.48k stars 254 forks source link

fixed number of visible rows for <Table> component #6477

Closed SchorschHarrison closed 1 year ago

SchorschHarrison commented 1 year ago

Hi, we are using the @ui5/webcomponents-react package.

Feature Request Description

There is currently no way for the regular table to display only a fixed number of rows. The Table will grow infinitely and resizes once new data is loaded or the content is filtered. 

Proposed Solution

We would like to see a prop similar to visibleRows in the AnalyticalTable. That would restrict the height of the table to a fixed number of rows. The table should also have the same height when empty. 

Priority

Impact

The used UI5 webcomponent table does change it height depending on found entries, so as a result when filtering or while loading data, the height of the table changes which leads to usability issues that table-related elements like the filter field does change its position, making it tricky for user to use those elements which must be avoided.

Stakeholder Info

Organization: SAP/CBC. This issue was also reported by L1 manager and responsible also for the CBC org.

niyap commented 1 year ago

Hello @SAP/ui5-webcomponents-topic-rl,

Could you please check that feature request?

Thank you in advance!

Kind Regards, Niya

hristop commented 1 year ago

Hi @SchorschHarrison ,

I have prepared a CodeSandbox: https://codesandbox.io/s/ui5-webcomponents-forked-087y8c?file=/index.html which illustrates how the desired behaviour can be achieved by over-styling the table component with height and overflow behaviour.

The height limit the table and the overflow: scroll will show the scroll inside the ui5-table element. In the example two other features of the Table component are used in order to further enhance the user experience - the sticky column headers and the scroll-to-load.

This approach will satisfy both mentioned criteria:

Hope this helps.

Best Regards, Hristo