Fix for search results overlay/scroll issue #3224
Unanswered
ioanamarinescu
asked this question in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Problem: When searching and scrolling through results, the homepage content shows through/overlaps with search results.
Solution: Add this CSS to
assets/css/custom.css
:/* Prevent body scroll when search is open */
body:has(#search:not(.hidden)) {
overflow: hidden !important;
}
/* Make search container scrollable /
#search:not(.hidden) {
position: fixed !important;
top: 0 !important;
left: 0 !important;
width: 100vw !important;
height: 100vh !important;
height: 100dvh !important; / This will fix the mobile UI bar issue /
background-color: white !important; / This is crucial */
z-index: 999999 !important;
overflow-y: auto !important;
}
/* Dark mode support for mobile - multiple selectors for better coverage */
.dark #search:not(.hidden),
[data-wc-theme="dark"] #search:not(.hidden),
html.dark #search:not(.hidden) {
background-color: #151f28 !important;
}
Beta Was this translation helpful? Give feedback.
All reactions