add a click handler to a quill object

1.7k views Asked by At

In Quill, I prepared a special span (just changing the background color) of some text. Now I would like to fire up a popup when a user clicks or double-clicks on that span. Doing that, it seems that Quill intercepts the event (which is not unexpected) but probably stops the propagation. Is there a way to make Quill not stop the propagation and allow for remaining click handlers to be called ?

I tried a

$("#idOfMySpan").unbind('click');

before binding with my handler but it doesn't work.

Thanks !

Damir

2

There are 2 answers

0
omikes On

This is a little wacky, but have you tried hiding the real button, and using a decoy button to:

  1. Trigger your custom event first.
  2. Then, trigger the original, hidden button.
0
user3047221 On

I just debugged the thing and Quill is perfectly transmitting the events, I was able to do what I wanted. But I keep your idea, just in case... :-) Thanks !