fix(Editor): prevent suggestion menu blinking on keystroke#270
Merged
Conversation
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
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.
Syncs upstream nuxt/ui commit
7e6d8b0— fix(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'sonStart/onUpdateacted on that pass — opening the menu with no items and destroying + recreating it on every keystroke (the blinking). The fix guards both handlers:onStart— thefilteredItemsassignment moves below aif (suggestionProps.loading) returnguard (aftertriggerClientRect), so the loading pass no longer opens the menu empty.onUpdate—commandFn = …is hoisted to the top (so the command stays current even during loading), thenif (suggestionProps.loading) returnruns before re-filtering, so the mounted menu isn't torn down and rebuilt mid-fetch.b24ui's
useEditorMenu.tshandlersmatched upstream's pre-fix shape, so both hunks applied 1:1.Verify (
CI=true)dev:prepare·lint·typecheck·test·build— all green.suggestionProps.loadingtypechecks against the tiptapSuggestionPropsb24ui already uses. Suite 5477 passed / 6 skipped. No test/snapshot changes (composable-only).Ledger: cursor advanced to
7e6d8b0; previous entryd56e39areconciled to PR #269.🤖 Generated with Claude Code
Generated by Claude Code