From a86eb1db4e55bfb4279af880506ae3b652c56bc4 Mon Sep 17 00:00:00 2001 From: Marius van der Busse <marius.vanderbusse@leaddesk.com> Date: Fri, 29 Oct 2021 17:52:25 +0300 Subject: [PATCH] A small update that allows text to be pasted manually into the textbox and fixes the error that happend when pasting manually --- async-clipboard/demo.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/async-clipboard/demo.js b/async-clipboard/demo.js index 5115fc39f1..9d22e4e65f 100644 --- a/async-clipboard/demo.js +++ b/async-clipboard/demo.js @@ -23,8 +23,7 @@ document.querySelector('#paste').addEventListener('click', () => { /** Watch for pastes */ document.addEventListener('paste', e => { - e.preventDefault(); - navigator.clipboard.getText().then(text => { + navigator.clipboard.readText().then(text => { ChromeSamples.log('Updated clipboard contents: ' + text); }); });