#11417 closed Bug (fixed)
Doubleclick event (documented) can never work
Reported by: | xmo | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | CKEditor 4.3.3 |
Component: | UI : Widgets | Version: | 4.3.1 |
Keywords: | Cc: |
Description
- Create trivial widget, hook
doubleclick
event to some operation (e.g.console.log
) - Open editor
- Double click widget
Expected: see operation execute Observed: nothing happens
Internally (in setupWidget
) the widgets plugin hooks into doubleclick
to trigger edit
(by calling widget.edit()
), then cancels the event leading to further event handlers being ignored.
As a result, listening to doubleclick
will never have any effect unless removeAllListeners
is invoked beforehand, which is obviously a terrible idea.
Possible solutions:
- make the handling of
doubleclick
customisable somehow - remove
doubleclick
from widget's documentation and documentedit
as firing on double click - ???
Change History (5)
comment:1 Changed 11 years ago by
comment:2 Changed 11 years ago by
Good point, thanks, I'd missed that. Still, not exactly obvious when you're trying to find out why your even does not fire (and the doc only says that the event is available).
comment:3 Changed 11 years ago by
Milestone: | → CKEditor 4.3.3 |
---|---|
Resolution: | → fixed |
Status: | new → closed |
I couldn't find any reason why it was cancelled, so I fixed it with git:c017cf5.
comment:4 Changed 11 years ago by
Summary: | doubleclick event (documented) can never work → Doubleclick event (documented) can never work |
---|
comment:5 Changed 10 years ago by
Unfortunately there was a reason why this event was cancelled and why was cancelling editor#doubleclick on widget.wrapper. See #12140. We will partially revert git:c017cf5.
It's always possible to do something with event, even if it's cancelled. You just need to add a listener with higher priority. For example:
The standard priority is 10.
However, I don't know why this event is cancelled now. It makes it harder to do something after doubleclick. Manual and automated tests seem to pass without cancelling, so there's a big chance that we'll fix this.