[FIX] web_editor: only bind cut/copy event to editor
Before this commit, cut/copy operation in non-html fields will trigger the _onClipboardCut/_onClipboardCopy handler as long as there is html field in the same form view. This will cause cut/copy fail when using chrome or edge. Only bind cut/copy event to html field as these event handlers are not related to non-html fields. closes odoo/odoo#109624 X-original-commit: 494f8300f848cf258ba8ba0132af104346083b3e Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
This commit is contained in:
@@ -601,9 +601,9 @@ export class OdooEditor extends EventTarget {
|
||||
this.addDomListener(this.editable, 'paste', this._onPaste);
|
||||
this.addDomListener(this.editable, 'dragstart', this._onDragStart);
|
||||
this.addDomListener(this.editable, 'drop', this._onDrop);
|
||||
this.addDomListener(this.editable, 'copy', this._onClipboardCopy);
|
||||
this.addDomListener(this.editable, 'cut', this._onClipboardCut);
|
||||
|
||||
this.addDomListener(this.document, 'copy', this._onClipboardCopy);
|
||||
this.addDomListener(this.document, 'cut', this._onClipboardCut);
|
||||
this.addDomListener(this.document, 'selectionchange', this._onSelectionChange);
|
||||
this.addDomListener(this.document, 'selectionchange', this._handleCommandHint);
|
||||
this.addDomListener(this.document, 'keydown', this._onDocumentKeydown);
|
||||
|
||||
Reference in New Issue
Block a user