Skip to content

[Bug]: Docs site Cmd+K search freezes the browser tab for certain queries (e.g. "headi", "heaq") #190

Description

@h8570rg

Prerequisites

  • I have searched existing issues to ensure this bug hasn't been reported already
  • I have tested this with the latest version of the components

Bug description

The Cmd+K / command-palette search on the documentation website
(https://www.untitledui.com/react/components) hangs the browser tab indefinitely for
certain search strings. The whole renderer process locks up — the input stops accepting
keystrokes, the page becomes unresponsive to clicks and scrolling, and the only way out is
to force-close the tab. This is not a slow render that eventually recovers: the tab was
still frozen after 45+ seconds of waiting.

It looks query-dependent rather than a general performance problem. Queries that match
nothing at all are fine; the hang seems to happen when the query is a near miss of
indexed entries — i.e. a prefix that matches many entries plus one non-matching character.
That pattern is typical of a fuzzy-matching routine with exponential blow-up (catastrophic
backtracking or unbounded recursion) rather than a rendering issue.

Observed behaviour by query

Query Result
head ✅ Works — shows Header navigations, Header sections, Hero header sections
headi ❌ Tab freezes permanently
heaq ❌ Tab freezes permanently
zzzz ✅ Works — "No results found"
buttonz ✅ Works — "No results found"

So zzzz and buttonz (zero results) are handled fine, while headi / heaq
(zero results, but sharing the hea prefix with many indexed entries) hang the tab. The
freeze happens on the keystroke that turns a matching query into a non-matching one.

Steps to reproduce

  1. Open https://www.untitledui.com/react/components
  2. Press Cmd+K (or click the search icon in the sidebar) to open the search modal
  3. Type head — results appear normally
  4. Type one more character, i, so the query is headi
  5. The tab freezes immediately and never recovers (same with heaq)

Expected behavior

The search should either show matching results or the "No results found" empty state, and
should stay responsive for any input string.

Actual behavior

The tab's renderer hangs indefinitely on the keystroke that makes the query stop matching.
The search input no longer accepts input, the page does not respond to clicks or scrolling,
and the tab has to be force-closed. Reproduced twice in two separate tabs.

Code example

N/A  this is the documentation website's search UI, not a component used in my own code.

Browser

Chrome

Device type

Desktop

Component version

N/A (documentation website, https://www.untitledui.com/react/components)

Environment details

Screenshots/Videos

No response

Console errors

Additional context

No response

Accessibility impact

  • This bug affects keyboard navigation
  • This bug affects screen reader users
  • This bug affects focus management
  • This bug affects color contrast or visual accessibility

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions