Skip to content

fix(www): cmd+K opening two search modals on the docs site#447

Merged
jrhizor merged 2 commits into
elmohq:mainfrom
dchaudhari7177:fix/docs-duplicate-search-modal
Jul 10, 2026
Merged

fix(www): cmd+K opening two search modals on the docs site#447
jrhizor merged 2 commits into
elmohq:mainfrom
dchaudhari7177:fix/docs-duplicate-search-modal

Conversation

@dchaudhari7177

Copy link
Copy Markdown
Contributor

Fixes #443

Problem

Pressing cmd+K / ctrl+K on /docs opens two stacked search modals.

Cause

RootProvider from fumadocs-ui mounts its own SearchProvider by default, which registers a global cmd+K/ctrl+K keydown listener and lazily renders the default fumadocs search dialog. The docs layout also renders the custom SearchDialog (via DocsSidebar), whose useSearchDialog hook registers its own cmd+K listener — so one keystroke opens both dialogs.

Fix

Pass search={{ enabled: false }} to RootProvider in docs-page-layout.tsx so the built-in fumadocs search stays unmounted and only the custom dialog handles cmd+K. Nothing in the repo consumes fumadocs' search context (useSearchContext/SearchOnly/SearchToggle have no usages), so disabling it has no other effect.

Verification

Ran apps/www locally and dispatched ctrl+K on /docs, counting [role="dialog"] elements:

  • before: 2 dialogs (placeholders Search — fumadocs default — and Search docs... — custom)
  • after: 1 dialog (Search docs...), search/navigation still working

tsc --noEmit passes for @workspace/www.

CLA

Added dchaudhari7177 to .github/contributors.txt per CONTRIBUTING.md.

RootProvider from fumadocs-ui mounts its own SearchProvider by default,
which registers a cmd+K/ctrl+K listener and renders the default fumadocs
search dialog. The docs layout also mounts the custom SearchDialog via
DocsSidebar, so pressing cmd+K opened both modals stacked on top of each
other. Pass search={{ enabled: false }} so only the custom dialog handles
search.

Also adds my username to contributors.txt to sign the CLA.

Fixes elmohq#443
@dchaudhari7177 dchaudhari7177 requested a review from jrhizor as a code owner July 10, 2026 21:49
@vercel

vercel Bot commented Jul 10, 2026

Copy link
Copy Markdown

@dchaudhari7177 is attempting to deploy a commit to the Blue Whale Labs Team on Vercel.

A member of the Team first needs to authorize it.

@jrhizor jrhizor left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for the contribution! Added on a small related change to hide the docs search from the blog pages but looks good!

@jrhizor jrhizor merged commit cc54a38 into elmohq:main Jul 10, 2026
1 check failed
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.

cmd+K on the docs site shows multiple search modals

2 participants