froala / wysiwyg-editor

The next generation Javascript WYSIWYG HTML Editor.
https://www.froala.com/wysiwyg-editor
Other
5.3k stars 675 forks source link

[v3 Breaking Change] - Pasted images from google doc cause site to freeze and uploads incorrectly. #3532

Closed GizMogwai closed 2 years ago

GizMogwai commented 5 years ago
Expected behavior.

Upon pasting an image from google docs into the v3 froala editor, it would upload the image to the configured s3 server.

Actual behavior.

when pasting an image from google docs into the v3 froala editor and opening code view, it makes the site unresponsive and does not follow the appropriate upload configuration.

Steps to reproduce the problem.
  1. Copy image from google docs
  2. paste image into froala v3 editor
  3. Open code view
Editor version.

v3

OS.

MacOS Mojave 10.14.5

Browser.

Chrome Version 75.0.3770.100

Recording.

2019-07-08 11 18 36

casualuser commented 5 years ago

Hi, When images pasted from GDocs into Froala Editor it will be inserted as base64 encoded image object. That depends actually on how exactly the source of image encodes it in clipboard during the copy process. It looks like your browser simple expected high load in case image was quite large and free mem was quite low or so.

http://recordit.co/NAQqVpgPMD

GizMogwai commented 5 years ago

Hi, When images pasted from GDocs into Froala Editor it will be inserted as base64 encoded image object. That depends actually on how exactly the source of image encodes it in clipboard during the copy process. It looks like your browser simple expected high load in case image was quite large and free mem was quite low or so.

http://recordit.co/NAQqVpgPMD

@casualuser This issue is new to v3. While using v2, i was, quite literally copy and pasting from google docs every day without an issue. It's an issue with the way that v3 receives the pasted content and it actually skips the upload configuration (in our case, that's uploadtos3).

This is not an issue with a) my clipboard or b) my computers free memory

This is an issue with Froala v3, because it works perfectly fine on froala v2.

GizMogwai commented 5 years ago

Side note - We have reverted to Froala v2 until you are able to fix this issue @casualuser We have also confirmed (yet again) that the issue is strictly with v3, as we are no longer experiencing the issue when we reverted to v2.

dplarina commented 5 years ago

Having the same problem. Pasting multiple images from any html source causes this problem. Pasting individual images works fine.

yjqxq commented 5 years ago

This problem I found from the first version of v3, reflected for 2 months, has not been fixed, a temporary solution, you can paste the click on the edit button and then save the image he will upload to the s3 server

yjqxq commented 5 years ago

Having the same problem. Pasting multiple images from any html source causes this problem. Pasting individual images works fine.

Paste the base64 image and he will upload it to the s3 server

kapil2704 commented 5 years ago

It is only happening in froala.com but not at any other place. So we just need to update the code in froala.com (froala-app) but nowhere else

GizMogwai commented 5 years ago

It is only happening in froala.com but not at any other place. So we just need to update the code in froala.com (froala-app) but nowhere else

That's incorrect. It happens on everyone's version of froala unless they have fixed this in a local patch that i'm unaware of.

kapil2704 commented 5 years ago

It is only happening in froala.com but not at any other place. So we just need to update the code in froala.com (froala-app) but nowhere else

That's incorrect. It happens on everyone's version of froala unless they have fixed this in a local patch that i'm unaware of.

Could you please create new video showing me this issue at some other place other than froala.com

GizMogwai commented 5 years ago

Could you please create new video showing me this issue at some other place other than froala.com

I'm not sure if you're from the Development team of Froala, or just a user of their product.

I can't create a new video because we reverted from v3 to v2, because this was broken on v3 and we needed this to work.

Side note - We have reverted to Froala v2 until you are able to fix this issue @casualuser We have also confirmed (yet again) that the issue is strictly with v3, as we are no longer experiencing the issue when we reverted to v2.

Rather than ask me to do it, perhaps do some testing yourself because it's clear from multiple people's responses in here that this is an issue with the Froala WYSIWYG editor everywhere, not just on froala.com.

We pay for froala, we expect to be able to use it properly.

tudewutong commented 5 years ago

Any update on this issue?

jianxcao commented 5 years ago

try this code

Image loading event did not trigger, so the active trigger under

const editor = new FroalaEditor('#editor-container', {
    events: {
      initialized() {
        const onMethod = editor.$.prototype.on;
        editor.$.prototype.on = function(...arg) {
          const name = arg[0];
          const res = onMethod.apply(this, arg);
          if (name === 'load') {
            this.each((index, e) => {
              if (e.nodeName && e.nodeName.toUpperCase() === 'IMG' && e.getBoundingClientRect) {
                if (e.getBoundingClientRect().height > 0) {
                  console.log('in trigger');
                  editor.$(e).trigger('load');
                }
              }
            });
          }
          return res;
        };
      },
    },
  });
kapil2704 commented 5 years ago

We have just resolved this issue it will be available in v3.0.6.