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

Already on GitHub? Sign in to your account

Fix Firefox image paste contenteditable hack #2094

Merged
merged 1 commit into from Mar 10, 2014

Conversation

3 participants
Contributor

vikhyat commented Mar 10, 2014

Still not 100% sure why the previous version wasn't working, for some reason on the second paste after the clipboard content changes Firefox would switch focus to the contenteditable div but not resume the paste. This doesn't happen if you paste the same text multiple times, only if you paste different text. Weird.

Inserting a contenteditable div once at the start and reusing it instead of inserting a new one on every paste fixes the problem.

Firefox: Reuse same contenteditable <div> instead of creating a new o…
…ne on paste.

This fixes the issue where every alternate paste from a different source
would not work because the content wasn't getting pasted into the
contenteditable div randomly.

You've signed the CLA, vikhyat. Thank you! This pull request is ready for review.

coding-horror added a commit that referenced this pull request Mar 10, 2014

Merge pull request #2094 from vikhyat/firefox-paste-image
Fix Firefox image paste contenteditable hack

@coding-horror coding-horror merged commit 3186ca8 into discourse:master Mar 10, 2014

Owner

coding-horror commented on 3b1ed99 Mar 10, 2014

I get weird cropped dimensions when I paste with Firefox?

http://try.discourse.org/t/this-is-a-new-test-topic/467/2?u=codinghorror

Image is 458 x 638 but it pastes in as 300 x 150 for some reason.. Firefox latest for Windows.

Contributor

vikhyat replied Mar 10, 2014

Most likely because I'm not setting dimensions on the canvas element, will fix tomorrow.

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