Issue #3549Opened June 19, 2021by anlumo0 reactions

BUG: createCustomEvent Doesn't Handle Mouse Events Correctly

Question

Version: 0.17.4 / git master

Describe the bug detailed

FrameView repackages keyboard and mouse events here:

https://github.com/artf/grapesjs/blob/07061ae1307fedf2a3b9bd585ce0cb30f653f112/src/canvas/view/FrameView.js#L389-L399

I think the reason is related to redirecting iframe events to parent frame events. This would be fine, however, the createCustomEvent function looks like this:

https://github.com/artf/grapesjs/blob/07061ae1307fedf2a3b9bd585ce0cb30f653f112/src/utils/dom.js#L63-L81

As you can see, the which property is defined to return the value of keyCode. This works for keyboard events, but on mouse events, it should return the value of which from the wrapped event.

This causes which to be undefined in the event, breaking an external package I use that relies on event.which for mouse events.

Answers (0)

No answers yet.

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.