Skip to content

fix(promptfields): keep wildcard autocomplete open while scrolling - #9999

Open
mvanhorn wants to merge 1 commit into
invoke-ai:mainfrom
mvanhorn:fix/9971-wildcard-autocomplete-scroll
Open

mvanhorn wants to merge 1 commit into
invoke-ai:mainfrom
mvanhorn:fix/9971-wildcard-autocomplete-scroll

Conversation

@mvanhorn

@mvanhorn mvanhorn commented Oct 23, 2026 •

Copy link
Copy Markdown

Summary

The wildcard suggestion list that opens from a positive prompt cannot be scrolled once it is taller than the popup. The mouse wheel and the scrollbar both close it immediately. Arrow keys do the same once the highlight leaves the initially visible rows: the list blinks shut, opens again, and the highlight is back on the first entry. Suggestions are dismissed on scroll and resize so the anchor does not stay put after the prompt moves.

Scrolls inside popover content were already skipped, but this list is a separate surface, so a scroll on the list or on an option inside it was treated as the field leaving the viewport and the list closed. Arrow-key movement that scrolls the same container hits that path, which remounts the list with the first entry selected.

The suggestion list element is marked with data-prompt-trigger-autocomplete. The dismiss-on-scroll check now exempts that element and popover content, using closest() so an option inside the list counts as internal. Window resize still dismisses, because its target is not an element scroll. A browser test supplies 24 wildcards, types the opening trigger, scrolls the overflowing listbox to the bottom, and asserts that the same listbox remains open with scrollTop greater than zero.

Related Issues / Discussions

Closes #9971

QA Instructions

Ran uv run --no-sync pytest -n logical locally on macOS for the InvokeAI change; it fails the same way on the base branch, so the failure predates this change (it fails the same way on upstream/main).
Tests for the InvokeAI change live in invokeai/frontend/webv2/src/features/generation/ui/promptFields/PositivePromptField.browser.test.tsx.

Review

Not applicable to this change.

Compatibility / Rollout

Not applicable to this change.

Checklist

  • The PR has a short but descriptive title, suitable for a changelog
  • Meaningful regression coverage added / updated where needed; obsolete tests/code removed
  • Persisted-state and API changes include required migrations / compatibility validation
  • Relevant performance/efficiency opportunities considered; material claims have evidence
  • Material review findings resolved and relevant checks rerun
  • Documentation added / updated (if applicable)
  • Updated What's New copy (if doing a release after this PR)

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

The suggestion list element is marked with
data-prompt-trigger-autocomplete. The dismiss-on-scroll check now
exempts that element and popover content, using closest() so an option
inside the list counts as internal. Window resize still dismisses,
because its target is not an element scroll. A browser test supplies 24
wildcards, types the opening trigger, scrolls the overflowing listbox to
the bottom, and asserts that the same listbox remains open with
scrollTop greater than zero.

Fixes invoke-ai#9971
@github-actions github-actions Bot added the frontend PRs that change frontend files label Oct 23, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

frontend PRs that change frontend files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug]: Unable to scroll in wildcard popup-list

1 participant