"Showing 1 to 0 of 0 results" in DataList footer
Maybe we must fix the display in footer, "Showing 1 to 0 of 0 results" seems to be not good ?
Originally posted by @Jessy-BAER in https://github.com/BearStudio/start-ui-web/issues/257#issuecomment-1225248162
Hi @yoannfleurydev , in the start-ui-web/src/components/Pagination/index.tsx file, there is :
export const getPaginationInfo = ({
page = 1,
pageSize = 10,
totalItems = 0,
}) => {
const firstItemOnPage = (page - 1) * pageSize + 1;
...
at line 22. So, (1-1)*10+1 = 0+1 = 1.
Due to that, it will always show "Showing 1 to 0" at least. Am I right?
Hi @yoannfleurydev , in the start-ui-web/src/components/Pagination/index.tsx file, there is :
export const getPaginationInfo = ({ page = 1, pageSize = 10, totalItems = 0, }) => { const firstItemOnPage = (page - 1) * pageSize + 1; ...at line 22. So, (1-1)*10+1 = 0+1 = 1.
Due to that, it will always show "Showing 1 to 0" at least. Am I right?
That's right, the default computation will return 1. We can probably do some check to get 0 or maybe add a skeleton while data is fetching.