Skip to content

Revise OffsetScrollPosition to use zero-based indexes #3072

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

Closed
wants to merge 2 commits into from

Conversation

christophstrobl
Copy link
Member

No description provided.

@@ -141,7 +149,7 @@ public OffsetScrollPosition apply(int offset) {
throw new IndexOutOfBoundsException(offset);
}

return of(startOffset + offset + 1);
return of(startOffset + offset);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about introducing a factory method for OffsetPositionFunction on OffsetScrollPosition to hide away offset.isInitial() ? 0 : offset.getOffset() as in OffsetScrollPosition.positionFunction(offset.isInitial() ? 0 : offset.getOffset()) on the calling code site?

@mp911de mp911de linked an issue Apr 10, 2024 that may be closed by this pull request
@mp911de mp911de added the type: enhancement A general enhancement label Apr 10, 2024
@mp911de mp911de changed the title Align Offset Scrolling Position to Keyset based variant. Revise OffsetScrollPosition to use zero-based indexes Apr 10, 2024
@mp911de mp911de added this to the 3.3 RC1 (2024.0.0) milestone Apr 10, 2024
mp911de pushed a commit that referenced this pull request Apr 10, 2024
mp911de added a commit that referenced this pull request Apr 10, 2024
Introduce method to obtain a position function from OffsetScrollPosition. Tweak documentation wording.

See #3070
Original pull request: #3072
@mp911de mp911de closed this Apr 10, 2024
@mp911de mp911de self-assigned this Apr 10, 2024
@mp911de mp911de deleted the issue/3070 branch April 10, 2024 08:47
natedanner pushed a commit to natedanner/spring-projects__spring-data-commons that referenced this pull request May 20, 2024
natedanner pushed a commit to natedanner/spring-projects__spring-data-commons that referenced this pull request May 20, 2024
Introduce method to obtain a position function from OffsetScrollPosition. Tweak documentation wording.

See spring-projects#3070
Original pull request: spring-projects#3072
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

Successfully merging this pull request may close these issues.

Window.positionAt should always return exact position of element
2 participants