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

Investigate possibility of Window.hasPrevious() #2795

Open
mp911de opened this issue Mar 20, 2023 · 1 comment
Open

Investigate possibility of Window.hasPrevious() #2795

mp911de opened this issue Mar 20, 2023 · 1 comment
Labels
type: enhancement A general enhancement

Comments

@mp911de
Copy link
Member

mp911de commented Mar 20, 2023

For scrolling across results, we already provide a hasNext indicator. It would be good to have a hasPrevious state as well.

For offset-based scrolling, we can get the information from the offset (e.g. a scroll that starts at offset 1 will not have a previous page). For keyset-scrolling, we would need to read from the current cursor and read another item more (two more in total) to determine a previous and next indicator).

@mp911de mp911de added the type: enhancement A general enhancement label Mar 20, 2023
@arturs678
Copy link

It seems sufficient to check the scrollPosition that was passed to the query. If the isInitial() method on the passed ScrollPosition returns false, we can assume that there is a previous window.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants