Skip to content
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

Easy Image doesn't trigger onChange event src/srcset is replaced with URL from server #155

Open
jswiderski opened this issue Dec 8, 2020 · 1 comment
Labels
status:confirmed An issue confirmed by the development team. type:bug A bug.

Comments

@jswiderski
Copy link

Are you reporting a feature request or a bug?

Provide detailed reproduction steps (if any)

  1. Use the following configuration:
handleChange = (e) => {
    console.log(e.editor.getData());
    this.setState({ data: e.editor.getData() });
  };

 <CKEditor
          onBeforeLoad={(CKEDITOR) => {
            return (CKEDITOR.disableAutoInline = true);
          }}
          data={this.state.data}
          type="classic"
          onChange={this.handleChange}
          config={{
            extraPlugins: "easyimage",
            removePlugins: "image",
            cloudServices_tokenUrl: "https://your-token-url",
            cloudServices_uploadUrl: "https://your-url"
          }}
        />
  1. Open browser console
  2. Load the editor and upload an image

Expected result

The Change event should be fired in both situations:

  • when image src attribute is set to blob e.g. <img alt="" src="blob:https://...
  • when the src attribute value is changed from blob to standard URL

Actual result

The Change event is only fired when image src attribute is set to blob e.g. <img alt="" src="blob:https://...

Other details

  • Browser: Any
  • OS: Any
  • Integration version: Any
  • CKEditor version: Any
  • Installed CKEditor plugins: easyimage
@jswiderski
Copy link
Author

There is an ugly workaround. Careful as it may hurt your eyes when looking but at least it gets the job done:

handleChange = (e) => {
    const that = this;
    const data = e.editor.getData(); 
    if( data.indexOf('blob:https')>=0 ) {
      const interval = setInterval(function(){   
        const newData = e.editor.getData();
        if(newData.indexOf('blob:https')< 0) {
          console.log( newData );
          that.setState({ data: newData }); 
          clearInterval(interval);
        }
      }, 500);

    }  
  }

@Dumluregn Dumluregn transferred this issue from ckeditor/ckeditor4-angular Dec 9, 2020
@Dumluregn Dumluregn added status:confirmed An issue confirmed by the development team. type:bug A bug. labels Dec 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:confirmed An issue confirmed by the development team. type:bug A bug.
Projects
None yet
Development

No branches or pull requests

2 participants