/claim #1283
What
Fixes #1283 by keeping suggestion menus open while IME composition is active, so Chinese/Japanese/etc. input can finish composing before the menu decides whether to close or whether the current query has no matching items.
Why
The menu could close during IME composition because ProseMirror can temporarily expose a non-empty selection while composition is active. The earlier discussion on #1295 pointed at EditorView.composing, so this PR uses ProseMirror’s own composition state instead of manual DOM composition event flags.
Changes
- Track
editor._tiptapEditor.view.composing in the core suggestion menu plugin state.
- Keep the active suggestion menu state during composition transactions instead of closing on temporary selection updates.
- Expose the core composition state to React suggestion wrappers.
- Pause the React no-items auto-close behavior while composition is active.
- Add a focused unit test for the IME composition selection-update path.
Verification
pnpm --filter @blocknote/core test -- SuggestionMenu.test.ts
pnpm --filter @blocknote/core build
pnpm exec tsc --noEmit -p packages/react/tsconfig.json
pnpm --filter @blocknote/react lint
pnpm --filter @blocknote/core lint
pnpm --filter @blocknote/react build
Demo
Local demo verified with the official mentions example at examples/06-custom-schema/02-suggestion-menus-mentions: typing @st keeps the menu open and filters to Steve. The hosted Vercel preview is currently blocked by the maintainer-team fork authorization gate.
Summary by CodeRabbit
-
Bug Fixes
- Suggestion menu no longer closes unexpectedly during IME/text composition; composing input preserves the menu and selection behavior.
- Menu update/hide logic now respects composition state so composition does not disrupt suggestions.
- Explicit close still works while composing.
-
Tests
- Added IME-focused tests to ensure the suggestion menu remains active during composition and closes when explicitly requested.
