FastUI icon indicating copy to clipboard operation
FastUI copied to clipboard

pagination component - can't go to page '1'

Open tim-x-y-z opened this issue 1 year ago • 2 comments

when on the cities pagination example in the demo app can't go back to page 1 when on another page.

tim-x-y-z avatar Jan 01 '24 08:01 tim-x-y-z

Nice find, I'll look soon.

samuelcolvin avatar Jan 01 '24 10:01 samuelcolvin

I found an issue here

Screenshot from 2024-01-03 00-16-11

Do we need this condition? https://github.com/pydantic/FastUI/blob/main/src/npm-fastui-bootstrap/src/pagination.tsx#L86-L90

I got the correct behavior when I added the onClick = { type: 'go-to', query: {page} } in place of onClick = { type: 'go-to', query: {} }. I guess the page represents the page number and not the total number of pages in the pagination, am I right?

I have changed the code here and it was working. I hope I have not missed anything. https://github.com/parthjoshi90/FastUI/commit/02cf514e6694c585e568520c8b06b34c5f3f0733

parthjoshi90 avatar Jan 02 '24 18:01 parthjoshi90