Closed GongRichard closed 1 year ago
The bug is very easy reproducible in the example. According to the documentation:
onLoadMore | Fired when the user presses the More button or scrolls to the table's end. Note: The event will be fired if growing is set to Button or Scroll.
Hello @SAP/ui5-webcomponents-topic-rl , take a look of this issue. The related doc: https://sap.github.io/ui5-webcomponents/playground/components/Table/ see the load more section
Hello @mindarelus ,
Could you please verify if the issue is present with plain ui5-table and return the ticket back to us with a link to a sample, where we could reproduce the issue with ui5 web components?
Thanks in advance!
Kind Regards, Elena
Hello @GongRichard,
I'm not able to reproduce the issue with plainTable
UI5 WebComponent.
https://codesandbox.io/s/ui5-webcomponents-forked-fo2wor?file=/index.html
The load-more
event is only triggered when the table is scrolled to the bottom.
If there is something missing in the snippet that needs to be added in order to reproduce the problem please do so.
Hello again, seems like the event is triggered when the table is scrolled to the end, but that is also true on initial rendering if there is no scroll present. I will check this with my team and respond to you with update shortly.
Hello @GongRichard, we discussed the issue and the observed behavior is desired. When the table is set to 'growing' and is rendered there is enough vertical space for all rows - the 'load-more' event is fired the same it is when scrolled to bottom, if scroll is present.
In your case you are rendering empty table and add the rows later but it case is the same - the table bottom end is visible so the event is fired. It can not know if there will be items added some time in the future in order to respond to this statement: loadmore event shouldn't be triggered if loading data finished after table rendering
Could you please elaborate what is your specific use case and why is this an issue for you. Thanks.
Hi @ndeshev, As we has lots of rows, we need do pagination. And we want to let user to scroll down to trigger the 'load-more' event to load more data. In this case, for the first time, it will auto trigger the 'load-more' event and load 2 pages data. It doesn't make sense to us. Thanks, Richard
Hello @GongRichard,
As @ndeshev has stated in his reply: "since the table bottom end is visible, the event is fired. We can not determine if there will be items added some time in the future."
I am closing this issue as we consider this to be the expeceted behavior of the event.
Best regards, Ivaylo
Bug Description
loadmore event will be triggered if set table row data later
Expected Behavior
loadmore event shouldn't be triggered if loading data finished after table rendering
Steps to Reproduce
Isolated Example
https://codesandbox.io/s/jolly-northcutt-mcgron?file=/src/App.js
Context
Log Output / Stack Trace / Screenshots
Priority
The priority indicates the severity of the issue. To set the appropriate priority consider the following criteria:
Note: The priority might be re-evaluated by the issue processor.
Stakeholder Info (if applicable)