New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix raw transforms not working in Edge when pasting content #10077

merged 1 commit into from Sep 30, 2018


None yet
2 participants

talldan commented Sep 20, 2018


I noticed raw transforms weren't being triggered in MS Edge when pasting markup.

This error is being thrown

Invalid attempt to spread non-iterable instance

that's being thrown on line 234 here:

const { items = [], files = [] } = clipboardData;
const item = find( [ ...items, ...files ], ( { type } ) => /^image\/(?:jpe?g|png|gif)$/.test( type ) );

items is a DataTransferItemList and files is null. Because files is null a default value of [] is not being set (in the destructuring on line 233).

I've added a check for both null and undefined using lodash isNil.

How has this been tested?

In Edge:

  • Paste some markup that will trigger a raw transform:
  • Observe that a table block is created and no errors are thrown.

Types of changes

Bug fix (non-breaking change which fixes an issue)


  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.

@talldan talldan self-assigned this Sep 20, 2018

@talldan talldan added this to the 4.0 milestone Sep 20, 2018

@talldan talldan changed the title from Handle files being null in Edge browser when pasting text content to Fix raw transforms not working in Edge when pasting content Sep 20, 2018


This comment has been minimized.

Show comment
Hide comment

talldan commented Sep 21, 2018

@talldan talldan referenced this pull request Sep 21, 2018


Add inlineStyle matcher for sourcing block attributes #10074

4 of 4 tasks complete

@talldan talldan requested review from tofumatt and noisysocks and removed request for tofumatt Sep 24, 2018


mcsf approved these changes Sep 30, 2018

@talldan talldan merged commit 07b55fb into master Sep 30, 2018

2 checks passed

codecov/project 48.64% (-0.01%) compared to e5d77bd
continuous-integration/travis-ci/pr The Travis CI build passed

@talldan talldan deleted the fix/edge-paste-issue branch Sep 30, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment