diff --git a/src/Input.ts b/src/Input.ts index 9f547333..615088b8 100644 --- a/src/Input.ts +++ b/src/Input.ts @@ -169,7 +169,11 @@ export class Input extends Container { const key = e.key; - if (key === 'Backspace') + if (key === 'v' && (e.ctrlKey || e.metaKey)) + { + this.pasteContent(); + + } else if (key === 'Backspace') { this._delete(); } @@ -730,4 +734,11 @@ export class Input extends Container this.inputMask.position.set(this.paddingLeft, this.paddingTop); } + + protected pasteContent() { + navigator.clipboard.readText().then((text) => { + this.value = text; + this.onChange.emit(this.value); + }); + } }