withspectrum / slate-mentions

Add support for mentions to your Slate editor.
MIT License
22 stars 5 forks source link

onMentionSelected hook #2

Open mxstbr opened 7 years ago

mxstbr commented 7 years ago

This would allow developers to specify how to render their selected mention. It should also be possible to allow them to make the suggestions array data any data structure they want, since they can just format it at the end to fit into the editor.

oyeanuj commented 7 years ago

I think a corresponding function that you might need is onMentionBackspace. The default can be the function that you have right now but the user can override it.

mxstbr commented 7 years ago

Agree, what about calling them onMentionSelection and onMentionDeletion?

oyeanuj commented 7 years ago

Maybe onMentionInsertion instead of selection (since arrow keys are technically selecting it?)