Skip to content

Conversation

@reakaleek
Copy link
Member

@reakaleek reakaleek commented Jan 14, 2026

Context

Clicking search results caused htmx:oobErrorNoTarget errors on slow networks. The error happened because the search popover was unmounting before htmx could complete its request.

Root cause

When the popover closed, the anchor element was removed from the DOM. htmx needs this element to exist during the entire request lifecycle.

Solution

Keep the popover mounted in the DOM, but control visibility with CSS.
isOpen={hasContent} → Popover stays in DOM while there is search text
CSS (visibility, opacity, pointer-events) → Controls show/hide

On click: Hide popover instantly with CSS (element stays in DOM)
After htmx completes: Blur the input field

Result

Instant visual feedback when user clicks a result
htmx works reliably on all network speeds
Clean user experience

This only happens in a production-like environment, hence I need to deploy it to test
@reakaleek reakaleek requested a review from a team as a code owner January 14, 2026 16:35
@reakaleek reakaleek requested a review from Mpdreamz January 14, 2026 16:35
@cotti cotti added the fix label Jan 14, 2026
@reakaleek reakaleek requested review from Mpdreamz and cotti January 14, 2026 21:38
@reakaleek
Copy link
Member Author

Re-requesting reviews because I changed the code significantly since the last review.

I was able to reproduce the error locally with a throttled network speed in chrome.

See more details in the PR description.

@reakaleek reakaleek changed the title Attempt to fix htmx linking in find docs Fix htmx navigation from "Find Pages" dropdown Jan 14, 2026
@reakaleek reakaleek changed the title Fix htmx navigation from "Find Pages" dropdown Fix HTMX navigation from "Find Pages" dropdown Jan 14, 2026
@reakaleek reakaleek merged commit 80f6599 into main Jan 15, 2026
30 checks passed
@reakaleek reakaleek deleted the feature/fix-htmx-links-in-find-docs branch January 15, 2026 07:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants