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

[Ready for Review] Save scroll positions and results to show #381

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

kea-roy
Copy link
Member

@kea-roy kea-roy commented Nov 24, 2024

Summary

This pull request includes several changes to improve the user experience by saving your scroll position and number of results loaded on the Home Page, Search Results Page, and the 4 location pages (north, west, etc..). The most important changes include the addition of scroll position saving, new properties for the ApartmentCards component, and the updates to multiple pages to utilize these new features.

Enhancements to ApartmentCards component:

Scroll position saving:

Page updates to utilize new features:

Test Plan

Tested scrolling features on Chromium browsers including mobile, and on Safari.

Notes

I could not find a way to remove the event listener on scroll quick enough before the page changes. When the page changes, the ApartmentCards component vanishes from the page in an instant, which pulls your scroll immediately to the top. This causes the scroll to save that top position when you change pages. To resolve this, I set a max scroll difference which would prevent it from updating the scrollY in sessionStorage if the scroll position changes too much per update. However, this means that if you scroll really fast to the bottom, it will not save.

@dti-github-bot
Copy link
Member

dti-github-bot commented Nov 24, 2024

[diff-counting] Significant lines: 140.

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