Conversation
Contributor
Member
Author
|
@mcsf I cannot reproduce this. Is this Chrome? |
mtias
reviewed
Jan 5, 2018
blocks/editable/index.js
Outdated
| this.props.onReplace( content ); | ||
| } else { | ||
| // Necessary to get the right range. | ||
| // Alse done in the TinyMCE paste plugin. |
4ed15cb to
fc4bffa
Compare
Contributor
|
@iseulde: yes, Chrome. See: |
Member
Author
|
@mcsf Cool, seeing the error now. :) |
Member
Author
|
It's finny that this error happens at code where there is the following comment: // WebKit/Blink might clone the div so
// lets make sure we remove all clones
// TODO: Man o man is this ugly. WebKit is the new IE! Remove this if they ever fix it! |
Member
Author
|
We're doing if (e.isDefaultPrevented() || isBrokenAndroidClipboardEvent(e)) {
pasteBin.remove();
return;
}So at first sight it seems like a bug in TinyMCE. |
Member
Author
|
See https://wordpress.slack.com/archives/C0UCMQP0F/p1515587384000026. I added a timeout (like the one for splitting content) to allow the pastern to be removed before we replace the block (and the editor). |
Member
Author
|
@mcsf How is it looking now? |
fc4bffa to
3ed190c
Compare
Contributor
Yay, it works now, thanks! |
mcsf
approved these changes
Jan 10, 2018
Member
Author
|
Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Description
Fixes #3537. In Chrome, image data paste fails because the
onPastePreProcessevent does not happen. TinyMCE has different paste logic and image data handling, so it would be better if we handle data paste early instead of letting it pass unnecessarily through TinyMCE.How Has This Been Tested?
Copy an image in Chrome and paste it in Gutenberg.
Checklist: