Fix paste of images when focus is in the composer
This commit is contained in:
parent
4ed70a873d
commit
4404429ec2
2 changed files with 12 additions and 6 deletions
|
@ -1,14 +1,16 @@
|
||||||
diff --git a/node_modules/quill/dist/quill.js b/node_modules/quill/dist/quill.js
|
diff --git a/node_modules/quill/dist/quill.js b/node_modules/quill/dist/quill.js
|
||||||
index 811b3d0..c8c4892 100644
|
index 811b3d0..313f301 100644
|
||||||
--- a/node_modules/quill/dist/quill.js
|
--- a/node_modules/quill/dist/quill.js
|
||||||
+++ b/node_modules/quill/dist/quill.js
|
+++ b/node_modules/quill/dist/quill.js
|
||||||
@@ -8917,9 +8917,9 @@ var Clipboard = function (_Module) {
|
@@ -8916,10 +8916,10 @@ var Clipboard = function (_Module) {
|
||||||
|
|
||||||
var _this = _possibleConstructorReturn(this, (Clipboard.__proto__ || Object.getPrototypeOf(Clipboard)).call(this, quill, options));
|
var _this = _possibleConstructorReturn(this, (Clipboard.__proto__ || Object.getPrototypeOf(Clipboard)).call(this, quill, options));
|
||||||
|
|
||||||
_this.quill.root.addEventListener('paste', _this.onPaste.bind(_this));
|
- _this.quill.root.addEventListener('paste', _this.onPaste.bind(_this));
|
||||||
- _this.container = _this.quill.addContainer('ql-clipboard');
|
- _this.container = _this.quill.addContainer('ql-clipboard');
|
||||||
- _this.container.setAttribute('contenteditable', true);
|
- _this.container.setAttribute('contenteditable', true);
|
||||||
- _this.container.setAttribute('tabindex', -1);
|
- _this.container.setAttribute('tabindex', -1);
|
||||||
|
+ // _this.quill.root.addEventListener('paste', _this.onPaste.bind(_this));
|
||||||
+ // _this.container = _this.quill.addContainer('ql-clipboard');
|
+ // _this.container = _this.quill.addContainer('ql-clipboard');
|
||||||
+ // _this.container.setAttribute('contenteditable', true);
|
+ // _this.container.setAttribute('contenteditable', true);
|
||||||
+ // _this.container.setAttribute('tabindex', -1);
|
+ // _this.container.setAttribute('tabindex', -1);
|
||||||
|
|
|
@ -34,9 +34,6 @@ export class SignalClipboard {
|
||||||
}
|
}
|
||||||
|
|
||||||
onCapturePaste(event: ClipboardEvent): void {
|
onCapturePaste(event: ClipboardEvent): void {
|
||||||
event.preventDefault();
|
|
||||||
event.stopPropagation();
|
|
||||||
|
|
||||||
if (event.clipboardData == null) {
|
if (event.clipboardData == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -53,6 +50,13 @@ export class SignalClipboard {
|
||||||
const text = event.clipboardData.getData('text/plain');
|
const text = event.clipboardData.getData('text/plain');
|
||||||
const html = event.clipboardData.getData('text/html');
|
const html = event.clipboardData.getData('text/html');
|
||||||
|
|
||||||
|
if (!text && !html) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
event.preventDefault();
|
||||||
|
event.stopPropagation();
|
||||||
|
|
||||||
const clipboardDelta = html
|
const clipboardDelta = html
|
||||||
? clipboard.convert(html)
|
? clipboard.convert(html)
|
||||||
: clipboard.convert(replaceAngleBrackets(text));
|
: clipboard.convert(replaceAngleBrackets(text));
|
||||||
|
|
Loading…
Reference in a new issue