Tiptap: Suggestions demo only works with items with spaces

Created on 10 Jan 2021  路  3Comments  路  Source: ueberdosis/tiptap

Describe the bug
The 'suggestions' demo does not work with items that do not contain any spaces.

Steps to Reproduce / Codesandbox Example
Steps to reproduce the behavior:

  1. Go to the source code of the demo: https://github.com/ueberdosis/tiptap/blob/main/examples/Components/Routes/Suggestions/index.vue
  2. Use the exact same code, but remove the space in one of the suggestions, for example change 'Sven Adlung' to 'SvenAdlung'.
  3. Type '@' in the editor and choose the item without spaces
  4. See the error in the console: 'TypeError: Cannot read property 'nodeType' of undefined'

Fork this or create a new Codesandbox replicating your error
https://codesandbox.io/s/vue-issue-template-forked-s1i2u => type @ and choose the first item (other items work without a problem)

Expected behavior
Same behavior as the items with spaces, obviously 馃槈

Screenshots
CleanShot 2021-01-10 at 17 44 27@2x

Environment

  • OS: macOS
  • Browser: Chrome
  • Version: 87
  • Mobile / Desktop: Desktop
bug

Most helpful comment

BTW: Today I finished the implementation of the suggestions plugin for tiptap 2. I found a different solution than used in #860. I added a custom clipboardTextSerializer so that you can override the text content of nodes. (This is probably only useful for atom nodes like mentions).

So this is definitely fixed in tiptap 2 馃檶

All 3 comments

@Priestch could it be something that's caused by the getTextBetween method in the Suggestions plugin? That's the latest change for Mentions https://github.com/ueberdosis/tiptap/commit/046babfd3a94222128f08cef653859ab66eaf3cd

BTW: Today I finished the implementation of the suggestions plugin for tiptap 2. I found a different solution than used in #860. I added a custom clipboardTextSerializer so that you can override the text content of nodes. (This is probably only useful for atom nodes like mentions).

So this is definitely fixed in tiptap 2 馃檶

@andreasvirkus This issue only happens after commit 046babf, and I can not figure out the reason , it seems the doc content is broken after select some user.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

asseti6 picture asseti6  路  3Comments

Auxxxxlx picture Auxxxxlx  路  3Comments

agentq15 picture agentq15  路  3Comments

pk-pressf1 picture pk-pressf1  路  3Comments

afwn90cj93201nixr2e1re picture afwn90cj93201nixr2e1re  路  3Comments