Capture the removed mention #289
-
Is there any way to invoke some function when you remove the mention by pressing the backspace? |
Beta Was this translation helpful? Give feedback.
Replies: 7 comments
-
I think you could listen to the keypress event, check for backapace key and then check the last child of the content editable element if it matches the mention element? |
Beta Was this translation helpful? Give feedback.
-
this is a BIG issue and makes the component non-useable |
Beta Was this translation helpful? Give feedback.
-
@code-cvc @MartinMalinda @ziaulrehman40 did you get any solution |
Beta Was this translation helpful? Give feedback.
-
See this #79 even though it's not the cleanest approach. A delete event would be a nice addition. |
Beta Was this translation helpful? Give feedback.
-
This is how I managed to get the deleted mentions: I added a text-change listener on the Quill editor and then check what mentions have been deleted.
Still will be good to have this as an event in the mention module. |
Beta Was this translation helpful? Give feedback.
-
I'm still newbie to quill and quill-mention but I had a similar issue in my project where I had to save the info articles ids when referenced by a FAQ Article. I've found this issue and codepen at the quill repo. It seems to be a similar problem/implementation, @ziaulrehman40 do you think that's still the case? couldn't this be added in the mention blot? |
Beta Was this translation helpful? Give feedback.
-
I implemented this solution which I hope is worthy for someone. In my case, I have all the options as
|
Beta Was this translation helpful? Give feedback.
I implemented this solution which I hope is worthy for someone.
In my case, I have all the options as
mentionOptions
and so every time something changes I search for thementions
in the editor usinggetContents()
, get themention
frommentionsOptions
, and call a function to update thementions
.