Fix scroll position on map viewport change

Scroll to bottom of .property-filters minus masthead height when
map viewport changes and results refresh. Only scrolls upward,
never down. Uses instant scroll behavior.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Hanson.xyz Dev
2025-12-17 02:13:25 -06:00
parent ecc182ebf9
commit 8cd630593d
2 changed files with 12 additions and 4 deletions
File diff suppressed because one or more lines are too long
@@ -1773,9 +1773,17 @@
InfiniteScrollState.pages = {}; InfiniteScrollState.pages = {};
InfiniteScrollState.pendingPage = null; InfiniteScrollState.pendingPage = null;
// Scroll to bottom edge of .property-filters - bottom margin + masthead height
var $filters = $('.property-filters').first();
var $masthead = $('#masthead');
if ($filters.length) {
var mastheadHeight = $masthead.length ? $masthead.outerHeight() : 0;
var targetScroll = $filters.offset().top + $filters.outerHeight() - mastheadHeight;
var currentScroll = window.scrollY || window.pageYOffset; var currentScroll = window.scrollY || window.pageYOffset;
if (currentScroll > 0) { // Only scroll up, never down
window.scrollTo(0, 0); if (currentScroll > targetScroll) {
window.scrollTo({ top: targetScroll, behavior: 'instant' });
}
} }
}, },