React-draft-wysiwyg: Prop stripPastedStyles is ignored

Created on 11 Dec 2017  路  12Comments  路  Source: jpuri/react-draft-wysiwyg

I have a react-draft-wysiwyg (1.12.0) component that has stripPastedStyles prop as true but it seems to be ignored.

Test scenario
insert a text from Word file to the editor

Probable bug
It seems like stripPastedStyles is ignored when you're passing also handlePastedText that returns true (which it does here, for HTML and code block) to the draftjs Editor.

So a solution that works for me is basically passing both handlePastedText={() => false} and stripPasedStyles as props to the react-draft-wysiwyg comp.

Most helpful comment

hi @jpuri , i'm currently having the same problem. stripPastedStyles does not work.
are you sure that you are not filtering the Editor props for stripPastedStyles on filterEditorProps function here?

i have created a pull request to fix this. please review.
thanks

All 12 comments

Have the same problem. Thanks @vaclav-zeman for the solution.

This "fix/solution" only worked until 1.12.0. In 1.12.1, it doesn't again.

I've encountered this bug too. stripPastedStyles is completely ignored.

As @yohcop mentioned, this fix is valid only for 1.12.0.

The issue has been fixed with version 1.12.5.

I have been updated to 1.12.5, but it seems like not work. @jpuri

Thanks @vaclav-zeman for the solution.

hi @jpuri , i'm currently having the same problem. stripPastedStyles does not work.
are you sure that you are not filtering the Editor props for stripPastedStyles on filterEditorProps function here?

i have created a pull request to fix this. please review.
thanks

Thanks @vaclav-zeman for the solution,
@jpuri I'm running on 1.12.5 and it still doesn't work for me...

There was actually a small issue still left in stripPastedStyles property, release 1.12.9 has the fix.

Works for me in 1.12.11. Thx!

it works on 1.12.13锛宼ks.

Please close it

Was this page helpful?
0 / 5 - 0 ratings

Related issues

DiegoGallegos4 picture DiegoGallegos4  路  4Comments

Satherial picture Satherial  路  4Comments

FriOne picture FriOne  路  3Comments

june50232 picture june50232  路  4Comments

Fireprufe15 picture Fireprufe15  路  4Comments