Skip to content

fix: ac-scroll fills remaining height in mobile overlay#43

Merged
mekarpeles merged 3 commits intomainfrom
fix/mobile-ac-scroll-fill-height
Apr 27, 2026
Merged

fix: ac-scroll fills remaining height in mobile overlay#43
mekarpeles merged 3 commits intomainfrom
fix/mobile-ac-scroll-fill-height

Conversation

@mekarpeles
Copy link
Copy Markdown
Member

Summary

  • In mobile full-screen overlay mode, .ac-scroll was capped at max-height: 40vh, leaving blank white space below the autocomplete list
  • Make .panel a flex-direction: column container so children stack in a defined-height layout
  • Give .ac-scroll flex: 1; min-height: 0 so it grows to fill whatever height remains after the back-bar, search input, chip row, and facet bar take their natural heights
  • Keep overflow: visible on .panel — facet dropdowns are positioned children that must not be clipped

Test plan

  • Open search on a mobile-width viewport (< 600 px) — the autocomplete list should reach the bottom of the screen with no white gap below it
  • With active filters showing the chip row, the list still fills down to the bottom
  • Opening a facet dropdown (Sort, Availability, etc.) still renders correctly without being clipped by the panel
  • All 208 static-analysis tests pass (npx vitest run)

Replaced max-height: 40vh cap with flex: 1; min-height: 0 so the
autocomplete list expands to fill whatever height remains after the
back bar, search input, chip bar, and facet bar. Panel becomes a flex
column while keeping overflow: visible so facet dropdowns aren't clipped.
Copilot AI review requested due to automatic review settings April 27, 2026 04:38
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adjusts the ol-search-bar mobile full-screen overlay layout so the autocomplete results list (.ac-scroll) expands to fill the remaining viewport height, eliminating the blank space previously caused by a fixed vh max-height.

Changes:

  • Make :host(.mobile-exp) .panel a column flex container to create a defined vertical layout.
  • Update :host(.mobile-exp) .ac-scroll to flex: 1 (with min-height: 0) so it consumes remaining space and scrolls naturally.
  • Update the mobile overlay CSS contract test to assert flex-based growth instead of a vh max-height.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
frontend/src/components/ol-search-bar.js Converts the mobile overlay panel to a column flex layout and makes .ac-scroll fill remaining height with scrolling.
frontend/src/components/ol-search-bar.mobile-overlay.test.js Updates the static CSS contract assertion to match the new flex-based overlay behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +679 to 680
:host(.mobile-exp) .ac-scroll { flex: 1; min-height: 0; max-height: none; overflow-y: auto; }
:host(.mobile-exp) .pf-bar { overflow: visible; flex-wrap: wrap; }
Copy link

Copilot AI Apr 27, 2026

Choose a reason for hiding this comment

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

At <=600px there is still a later @media (max-width: 600px) { .ac-scroll { max-height: 40vh; } } rule, which now conflicts with this :host(.mobile-exp) .ac-scroll { max-height: none; ... } change. It works today due to selector specificity, but it’s fragile/confusing—consider scoping the 600px rule to non-overlay (e.g. :host(:not(.mobile-exp)) .ac-scroll) or otherwise removing/rewriting it so overlay/non-overlay behavior is explicit.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Good catch. Fixed in 9331633: scoped the rule to :host(:not(.mobile-exp)) .ac-scroll so overlay and non-overlay modes are explicitly separate — no more relying on specificity ordering to determine which max-height wins.

Comment thread frontend/src/components/ol-search-bar.mobile-overlay.test.js
Two bugs reported after the initial flex fill:
1. Body behind position:fixed overlay was still scrollable — visually a
   full-page scrollbar appeared. Fix: lock document.body.style.overflow
   when _mobileExpanded, restore it on close or disconnect.
2. Shrinking the browser window clipped content at the bottom rather
   than scrolling — .search-outer and .panel lacked min-height:0 so the
   flex chain couldn't constrain their heights. Fix: add min-height:0 to
   both; change .panel overflow to hidden (safe in full-screen mode since
   facet dropdowns stay within the panel's viewport-sized bounds).
…ight tests

Address Copilot review comments on PR #43:
- Scope @media(max-width:600px) .ac-scroll to :host(:not(.mobile-exp)) so
  overlay and non-overlay modes are explicitly separate rather than relying
  on selector specificity to determine which max-height wins.
- Add contract tests asserting .panel is display:flex/flex-direction:column
  and .ac-scroll has min-height:0 in mobile-exp, protecting the full flex
  layout intent against future regressions.
@mekarpeles mekarpeles merged commit 2fd2330 into main Apr 27, 2026
2 checks passed
@mekarpeles mekarpeles deleted the fix/mobile-ac-scroll-fill-height branch April 27, 2026 17:32
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