Plugin Wysiwyg problems with paste


Topic: Plugin Wysiwyg problems with paste

gianlucagiacometti pro premium priority asked 6 years ago

Hello, I'm experiencing problems with the WYSIWYG editor

Expected behavior

Copy and paste in editor without doing anything else, click send, I expect the text to be sent

Actual behavior

No text is sent unless you keypress something in the editor

Workaround

I found this workaround

      key: "bindEvents",
      value: function bindEvents() {
+++     var _this = this;
        $("#wysiwyg-".concat(this.uuid)).on('keypress', this.updateNativeTextarea.bind(this));
+++        $("#wysiwyg-".concat(this.uuid)).on('change', this.updateNativeTextarea.bind(this));
+++        $("#wysiwyg-".concat(this.uuid)).on('paste', function(e) {
+++                e.preventDefault();
+++                var pastedValue = e.originalEvent.clipboardData.getData('text/html');
+++                document.execCommand('insertHTML', false, pastedValue.replace(/^\s+|\s+$/g, ''));
+++                $("#wysiwyg-".concat(_this.uuid)).trigger('change');
+++        });

Well, without this functionality the plugin is quite useless, although I appreciate a lot the chance to translate button names and actions. Can you please think about an improvement? I'm switching to tinyMCE for the moment but I hope to come back to this as soon as it's fixed.

Another problem is the position of tooltips if the editor is set in scrolling modals. I guess there should be some investigations on positioning and overflow.


Bartłomiej Malanowski staff pro premium commented 6 years ago

Thank you for sharing your opinion and workaround with us! I think we can implement your solution in our WYSIWYG editor in the nearest future


Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Open

Specification of the issue
  • User: Pro
  • Premium support: Yes
  • Technology: MDB jQuery
  • MDB Version: 4.7.5
  • Device: All
  • Browser: All
  • OS: All
  • Provided sample code: No
  • Provided link: No