Open KrishaTerranIO opened 1 year ago
typing a space still not working well, it gets stuck in suggestion mode after typing an @ and there is no way to get out of it. Might need to update tiptap to latest version and explore a solution like this https://github.com/ueberdosis/tiptap/issues/214#issuecomment-964557956 (https://codesandbox.io/p/sandbox/tiptap-mention-ddfcm?file=%2Fsrc%2Fcomponents%2FsuggestionPlugin.js) which is unfortunately in Vue so would have to be translated to React
ooh someone just added to the tiptap issue above this solution that may work for us:
onUpdate(props) {
if (renderer) {
renderer.updateProps(props)
}
if (!popup || !props.clientRect) return
const matches = props?.query?.match(/([\s]+)/g)
const spacesCount = matches?.length || 0
if (spacesCount > 1 && props.items === null) {
popup?.[0]?.hide()
return
}
popup[0].setProps({ getReferenceClientRect: props.clientRect })
},
https://user-images.githubusercontent.com/92816219/219180945-58b3d31e-ae7a-41b7-9065-8e3d444ec77f.mov