Repository navigation
fix(Typeahead): preserve pending searches across source replacement - #8017
Merged
imdreamrunner merged 1 commit intoOct 23, 2026
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
|
AI review status for this pull request.
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
User impact
Stacked follow-up to #6360. A caller that constructs
searchSourceinline and updates state inonChangeQuerycan type normally but never receive suggestions: the parent render replaces the source during the debounce delay.This PR restores pending typed searches in
BaseTypeahead,Typeahead, andTokenizerwithout changing their selection behavior.Problem and solution fit
The source-replacement effect called the same invalidation path as a terminal close. That canceled an input-owned debounce timer even though its query still needed searching. No request ran, so the person could not find or choose a value.
A replacement now invalidates and releases started old-source work, but leaves the pending timer at its original deadline. When the timer fires, search/bootstrap use the latest committed source.
Expected behavior and authority
component:TokenizerAV6 and DEC-2 require preserving typed-query and direct single-select behavior. The existing default-debounce source interface permits a source supplied during render; recreating it must not silently discard an unstarted query.architecture:react-component-runtimeINV3–INV5 governs request/timer ownership and committed source synchronization.Smallest restoration
Other review findings in #6360 are outside this follow-up: this does not change highlight-state representation, restore the original cancellation callback ordering, trim the parent PR, or rebase it onto
main.Evidence
onChangeQuery-driven inline-source recreation across all three components.Browser evidence
Chromium 144.0.7559.133, neutral theme, light mode, LTR, 1280×800 at DPR 1, fine pointer/hover, no forced colors or reduced motion. Every frame checked the rendered theme, computed mode/direction, query value, focus, option count, active descendant, visible non-zero subject geometry, settled fonts, and absence of visible error screens/page errors. Typed-query pairs differ only in whether results appear; the retained-selection pair is pixel-identical.
Before arm: exact parent implementation plus the same inline-source story fixture used after. After arm: fix commit
469b34137fc750f03f39b4ddab1847969f318adf. No unrelated production delta.Before/after frames: typed searches restored; retained selection unchanged
Capture sensor receipts
469b34137fc750f03f39b4ddab1847969f318adf, same fixturesa11y-tokenizer-consecutive-selectiondirect-base-typeahead, direct-typeahead, inline-source-tokenizer, capped-cohortcolor-scheme: lightltrStack
Base
stack/pr-6360-baseis an unchanged snapshot of #6360 atc2e153fe18787750aaf8c7f7972cb6136a95671a. The feature branch has one additional fix commit; #6360 and its author's branch are untouched. Retarget/rebase ontomainafter the parent lands. Normal CI targetsmain, so it will not run against this temporary stack base.Scope
Testing
pnpm lint:strict: passed.pnpm build: passed.pnpm -F @astryxdesign/core typecheck: passed.No physical assistive-technology session or cross-browser matrix was run. This fix does not alter layout, keyboard handling, or ARIA markup.