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

Prevent toggling between min and max scroll offsets at end of grid #267

Merged

Conversation

MarkFalconbridge
Copy link
Contributor

Fixes #257

Prevents toggling between the calculated minOffset and maxOffset when minOffset is greater than maxOffset owing to the scrollbar size.

@@ -65,6 +65,8 @@ const FixedSizeGrid = createGridComponent({
default:
if (scrollLeft >= minOffset && scrollLeft <= maxOffset) {
return scrollLeft;
} else if (minOffset > maxOffset) {
return minOffset;
Copy link
Owner

Choose a reason for hiding this comment

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

I think this needs an explanatory comment, because it looks like a bug at first glance 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fair point! Now added.

Copy link
Owner

Choose a reason for hiding this comment

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

Looks like you added other places but missed this one 😆

Copy link
Owner

@bvaughn bvaughn left a comment

Choose a reason for hiding this comment

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

Thanks!

@@ -65,6 +65,8 @@ const FixedSizeGrid = createGridComponent({
default:
if (scrollLeft >= minOffset && scrollLeft <= maxOffset) {
return scrollLeft;
} else if (minOffset > maxOffset) {
return minOffset;
Copy link
Owner

Choose a reason for hiding this comment

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

Looks like you added other places but missed this one 😆

@bvaughn bvaughn merged commit c035eee into bvaughn:master Jun 18, 2019
@bvaughn
Copy link
Owner

bvaughn commented Jun 18, 2019

Published in 1.8.3

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

Successfully merging this pull request may close these issues.

FixedSizeGrid.scrollToItem sometimes scrolls the item only half into view
2 participants