Skip to content

Mention - custom combobox component #2215

Answered by 12joan
fbolcic asked this question in Q&A
Discussion options

You must be logged in to vote

@zbeyens might be able to provide a more direct answer to your questions, but here's what I did in my own app to replace the combobox used for mentions.

Disclaimers:

  • This probably isn't the recommended way of customising the combobox
  • There might be non-idiomatic use of the Plate API in this example; I wrote it a while ago
  • There's a lot of internal code in this example that won't be relevant to you

Make a custom mention input component with its own combobox:

MentionInputComponent
const MentionInputComponent = ({ editor, attributes, children, element }) => {
  const { futurePartialDocuments, mentionSuggestionsContainerRef } = useContext()

  const handleSelectItem = item => getMentionOnS…

Replies: 3 comments 3 replies

Comment options

You must be logged in to vote
3 replies
@fbolcic
Comment options

@12joan
Comment options

@fbolcic
Comment options

Answer selected by fbolcic
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants