guardian / scribe

DEPRECATED: A rich text editor framework for the web platform
http://guardian.github.io/scribe/
Apache License 2.0
3.51k stars 245 forks source link

Clipboard paste #401

Closed alexeygolev closed 9 years ago

alexeygolev commented 9 years ago

Getting "event.clipboardData.types.contains is not a function" when attempting to paste. The same here http://guardian.github.io/scribe/. Chrome 43.0.2357.130, 45.0.2439.0 canary, Opera 30.0.1835.59, Safari 8.0.6. Works in Firefox though

hntrdglss commented 9 years ago

I'm experiencing the same, using the NPM release with webpack.

rrees commented 9 years ago

@alexeygolev I've deployed 1.4.6 to the Github pages, can you retest?

rrees commented 9 years ago

@alexeygolev @cutandpastey @regiskuckaertz Regis pointed out that FF might not be Array-like so the fix may have broken FF. Can you check?

We might need to use a fixed data structure to reconcile the behaviours (at least I understand why the Lodash function was being used now).

alexeygolev commented 9 years ago

@rrees it indeed did break in FF. Works in Chrome, Opera and Safari

in FF the event.clipboardData.types is a DOMStringList which has a .contains() method.

[].slice.call(event.clipboardData.types) unifies the behaviour in all browsers. I could make a pull request if this solution is ok for you, guys

rrees commented 9 years ago

@alexeygolev Okay, I have taken on your suggestion and this should now work for all browsers (release 1.4.8 or later).

rrees commented 9 years ago

@alexeygolev I think release 1.4.13 might be the definitive solution for this. Do you want re-test and confirm?

alexeygolev commented 9 years ago

@rrees yep... works across the browsers...cheers