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

Added bring to focus functionality #585

Merged
merged 5 commits into from
Jan 25, 2021
Merged

Added bring to focus functionality #585

merged 5 commits into from
Jan 25, 2021

Conversation

anirudhagarwal365
Copy link
Collaborator

This PR adds a feature to bring to focus a particular index. This API is almost similar to scrollToIndex, but differs when the view is already in viewport. Instead of bringing the view to the top of the viewport, it will calculate the overflow the the selected index and scroll to just bring the entire view to viewport.

@@ -242,6 +242,28 @@ export default class RecyclerListView<P extends RecyclerListViewProps, S extends
}
}

public bringToFocus(index: number, animate?: boolean): void {
Copy link
Collaborator

Choose a reason for hiding this comment

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

@anirudhagarwal365 can you also add documentation around this in readme and as a comment?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@naqvitalha naqvitalha merged commit 782e6eb into master Jan 25, 2021
@naqvitalha naqvitalha deleted the bring-to-focus branch January 25, 2021 11:36
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.

2 participants