EDIT: I realize this was fixed by fix: suggestion menu behaviour (BLO-1283, BLO-955) #2930
What’s broken?
Suggestion menus with a multi-character trigger, such as [[, do not open when other text appears earlier in the same text block:
- Typing
[[ at the beginning of an empty paragraph opens the suggestion menu.
- Typing
Something [[ does not open it.
The problem is in SuggestionMenu's handleTextInput implementation. When the final character of a multi-character trigger is entered, the handler reads triggerCharacter.length existing characters and then appends the newly entered character:
What did you expect to happen?
A multi-character suggestion trigger should open wherever the trigger is typed in an eligible text block, regardless of what text appears before it.
Steps to reproduce
- Configure a
SuggestionMenuController with a multi-character trigger:
<SuggestionMenuController
triggerCharacter="[["
getItems={getItems}
/>
- Focus an empty paragraph and type
[[.
- Observe that the suggestion menu opens.
- Close the menu or create another paragraph.
- Type
test [[.
- Observe that the suggestion menu does not open.
BlockNote version
v0.46.2
Environment
Firefox/Chromium on Windows with React 19
Additional context
No response
Contribution
Sponsor
EDIT: I realize this was fixed by fix: suggestion menu behaviour (BLO-1283, BLO-955) #2930
What’s broken?
Suggestion menus with a multi-character trigger, such as
[[, do not open when other text appears earlier in the same text block:[[at the beginning of an empty paragraph opens the suggestion menu.Something [[does not open it.The problem is in
SuggestionMenu'shandleTextInputimplementation. When the final character of a multi-character trigger is entered, the handler readstriggerCharacter.lengthexisting characters and then appends the newly entered character:What did you expect to happen?
A multi-character suggestion trigger should open wherever the trigger is typed in an eligible text block, regardless of what text appears before it.
Steps to reproduce
SuggestionMenuControllerwith a multi-character trigger:[[.test [[.BlockNote version
v0.46.2
Environment
Firefox/Chromium on Windows with React 19
Additional context
No response
Contribution
Sponsor