sproutcore / rich-text-editor

A rich text editor for SproutCore.
Other
6 stars 6 forks source link

Fixed bug when calling allowDefault() on browser event rather SC.Event #32

Closed jameschao closed 7 years ago

jameschao commented 7 years ago

When pasting, there's a bug where we call allowDefault() on the browser's event object rather than SC.Event.

Details: the original code assigns evt = evt.originalEvent, where originalEvent is a browser event object. However, later on, if that event doesn't support clipboardData (on line 1022), the code calls allowDefault() on that browser object, even though allowDefault() is an SC.Event method.

The fix here is to avoid reassigning evt, so that evt remains the SC.Event instance.

mauritslamers commented 7 years ago

Great catch, thanks for the PR!