Skip to content

fix: hide the Vue School banner while search is open on mobile - #208

Merged
NathanWalker merged 2 commits into
mainfrom
fix/docsearch-above-banner
Nov 12, 2026
Merged

NathanWalker merged 2 commits into
mainfrom
fix/docsearch-above-banner

Conversation

@NathanWalker

@NathanWalker NathanWalker commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Problem

On mobile, opening search on docs.nativescript.org shows the Vue School "Free Weekend" banner over the top of the search input and Cancel button, so you can't see or tap the field.

banner.js pins its container (#bb-banner-container) with position: fixed; z-index: 99999. DocSearch's modal is z-index: 200, and at 768px and below it goes full-screen with the input at the very top, right under the banner.

Fix

Add a <style> head entry right after the banner script that hides the banner only while search is open on mobile:

@media (max-width: 768px) {
  body.DocSearch--active #bb-banner-container { display: none !important; }
}
  • DocSearch adds DocSearch--active to <body> while the modal is open and removes it on close, so the banner comes back as soon as search closes.
  • 768px is DocSearch's full-screen breakpoint. Above it the modal is a centered dialog, and the banner is left alone.
  • !important overrides the banner script's own inline display on the container. The script forces display with !important only on its inner iframe, never on the container.

No theme changes.

How to test

On a phone (or devtools at about 390px wide), open the Cloudflare Pages preview for this PR and wait for the banner. Tap search: the banner should disappear and the input and Cancel button should be fully visible. Close search: the banner should come back.

I checked this in headless Chromium against docs.nativescript.org with the rule injected:

Viewport Before search Search open After close
390×844 banner visible banner hidden; a tap on the input lands on #docsearch-input banner visible
1280×800 banner visible banner visible (unchanged) banner visible

The banner is position:fixed with z-index 99999 and DocSearch's container
is z-index 200, so on mobile the banner covered the full-screen search
input and Cancel button.
@coderabbitai

coderabbitai Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 62f36aed-0dd9-48a1-85fc-01a41d844338

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Deploying nativescript-docs-latest with  Cloudflare Pages  Cloudflare Pages

Latest commit: d1c4b77
Status: ✅  Deploy successful!
Preview URL: https://b336b59f.nativescript-docs-beta.pages.dev
Branch Preview URL: https://fix-docsearch-above-banner.nativescript-docs-beta.pages.dev

View logs

Replaces the DocSearch z-index override with a narrower rule: below
DocSearch's 768px full-screen breakpoint, hide #bb-banner-container
while body.DocSearch--active is set. Desktop and the closed state are
unchanged.
@NathanWalker NathanWalker changed the title fix: keep search modal above the Vue School banner on mobile fix: hide the Vue School banner while search is open on mobile Nov 12, 2026
@NathanWalker
NathanWalker merged commit 905003e into main Nov 12, 2026
5 of 6 checks passed
@NathanWalker
NathanWalker deleted the fix/docsearch-above-banner branch November 12, 2026 21:15
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.

1 participant