KillerCodeMonkey / ngx-quill-example

demo app for the advanced usage of ngx-quill module
214 stars 127 forks source link

onPaste scroll move to top #239

Closed virendrasinghpawar closed 4 years ago

virendrasinghpawar commented 4 years ago

I tried different workaround this but it's not fixed ,pasting here the code which cause the issue and it's known bug. `{ key: 'onPaste', value: function onPaste(e) { var _this2 = this;

  if (e.defaultPrevented || !this.quill.isEnabled()) return;
  var range = this.quill.getSelection();
  var delta = new _quillDelta2.default().retain(range.index);
  var scrollTop = this.quill.scrollingContainer.scrollTop;
  this.container.focus();
  this.quill.selection.update(_quill2.default.sources.SILENT);
  setTimeout(function () {
    delta = delta.concat(_this2.convert()).delete(range.length);
    _this2.quill.updateContents(delta, _quill2.default.sources.USER);
    // range.length contributes to delta.length()
    _this2.quill.setSelection(delta.length() - range.length, _quill2.default.sources.SILENT);
    _this2.quill.scrollingContainer.scrollTop = scrollTop;
    _this2.quill.focus();
  }, 1);
}

}`

how can i overwrite this code which is present inside quill.js

KillerCodeMonkey commented 4 years ago

just ask this in the quill repo=?

this has nothing to do with ngx-quill nor this example repo.