Hylozoic / hylo-evo

Hylo UI
Apache License 2.0
36 stars 10 forks source link

Issues with @tagging people #1458

Open KrishaTerranIO opened 1 year ago

KrishaTerranIO commented 1 year ago

https://user-images.githubusercontent.com/92816219/219180945-58b3d31e-ae7a-41b7-9065-8e3d444ec77f.mov

tibetsprague commented 3 weeks 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

tibetsprague commented 3 weeks ago

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 })
},