mkhstar / suneditor-react

A React Component for SunEditor (WYSIWYG editor)
http://suneditor.com/
427 stars 105 forks source link

onPaste prop not working in version 3.5.0 #314

Closed spxrtot closed 1 year ago

spxrtot commented 1 year ago

Describe the bug Starting from version 3.5.0 of suneditor-react, the onPaste prop is no longer being initialised. functions.onPaste is always null, hence typeof functions.onPaste === 'function' is always false on line 8032 of core.js

This works fine for versions <= 3.4.1.

Related repository

To Reproduce Steps to reproduce the behavior in version 3.5.0:

  1. Add the onPaste prop to the component, i.e.:
  2. Define the handlePaste method, i.e. const handlePaste= () => console.log('test paste')

Expected behavior Expected: 'test paste' printed in console Actual: nothing printed in console because the handlePaste method is not called (seen as null I think)

Desktop (please complete the following information):

mkhstar commented 1 year ago

Latest version should fix, thanks