inokawa / rich-textarea

A small customizable textarea for React to colorize, highlight, decorate texts, offer autocomplete and much more.

Home Page:https://inokawa.github.io/rich-textarea/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[feature] When the cursor is to the right of Mention, press the Delete key to delete the entire Mention

GOWxx opened this issue · comments

commented

Expect the entire Mention to be treated as a whole

Hi,
You can get caret offset with onSelectionChange prop, so you can achieve the behavior if you slice text state when the carret offset is under the mention range.

I know it's bit complicated but I don't think I could implement it as core, because this library is not only for mention.
However it's nice to implement a helper function or component to achieve the behavior easily, or add some example which helps to implement it.

commented

thank you for your reply ^ ^