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

negative values for the current page number in the use_pagination #15

Closed
CrystalWindSnake opened this issue Sep 19, 2023 · 1 comment
Closed
Labels
bug Something isn't working

Comments

@CrystalWindSnake
Copy link
Owner

from nicegui import ui
from ex4nicegui import on
from ex4nicegui.reactive import use_pagination


page = use_pagination(list(range(100)))


@on(page.current_page)
def _():
    print(page.current_page.value)


ui.button("prev page", on_click=page.prev)
ui.button("next page", on_click=page.next)


ui.run()

If you keep clicking the previous page, the value of the current page in the console will be less than 0.

@CrystalWindSnake CrystalWindSnake added the bug Something isn't working label Sep 19, 2023
@CrystalWindSnake
Copy link
Owner Author

The number of pages should be controlled by the user

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant