Skip to content

fix(Editor): prevent suggestion menu blinking on keystroke#270

Merged
IgorShevchik merged 1 commit into
mainfrom
sync/nuxt-7e6d8b0
Jul 10, 2026
Merged

fix(Editor): prevent suggestion menu blinking on keystroke#270
IgorShevchik merged 1 commit into
mainfrom
sync/nuxt-7e6d8b0

Conversation

@IgorShevchik

Copy link
Copy Markdown
Collaborator

Syncs upstream nuxt/ui commit 7e6d8b0fix(Editor): prevent suggestion menu blinking on keystroke (#6712).

What

The tiptap suggestion plugin emits a loading pass (placeholder/empty items) before the resolved items arrive. useEditorMenu's onStart/onUpdate acted on that pass — opening the menu with no items and destroying + recreating it on every keystroke (the blinking). The fix guards both handlers:

  • onStart — the filteredItems assignment moves below a if (suggestionProps.loading) return guard (after triggerClientRect), so the loading pass no longer opens the menu empty.
  • onUpdatecommandFn = … is hoisted to the top (so the command stays current even during loading), then if (suggestionProps.loading) return runs before re-filtering, so the mounted menu isn't torn down and rebuilt mid-fetch.

b24ui's useEditorMenu.ts handlers matched upstream's pre-fix shape, so both hunks applied 1:1.

Verify (CI=true)

dev:prepare · lint · typecheck · test · build — all green. suggestionProps.loading typechecks against the tiptap SuggestionProps b24ui already uses. Suite 5477 passed / 6 skipped. No test/snapshot changes (composable-only).

Ledger: cursor advanced to 7e6d8b0; previous entry d56e39a reconciled to PR #269.

🤖 Generated with Claude Code


Generated by Claude Code

The tiptap suggestion plugin emits a loading pass with placeholder items
before the resolved items arrive; onStart/onUpdate acted on it, opening
the menu empty and destroying+recreating it on every keystroke. Guard
both handlers with an early return on suggestionProps.loading (hoisting
commandFn in onUpdate so the command stays current during loading).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JS8ypVfQSFzYVZzkTHhURb
@IgorShevchik IgorShevchik merged commit 4a31c05 into main Jul 10, 2026
1 check passed
@IgorShevchik IgorShevchik deleted the sync/nuxt-7e6d8b0 branch July 10, 2026 18:45
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.

2 participants