C
C
CoolBatman2732017-10-25 14:31:11
JavaScript
CoolBatman273, 2017-10-25 14:31:11

Why can't I paste text to the clipboard on IOS?

I'm trying to paste text into the clipboard with: Checking with:
event.clipboardData.setData('text/plain', myText);

console.log(event.clipboardData.getData("text/plain"));

Returns an empty string - nothing.
This kind of pasting is needed to keep track of any text selection and copying by the user, so "document.execCommand("copy");" does not fit.
Also, this approach does not work, it does not paste the text into the clipboard, in FF browsers it sees that "event.clipboardData" is undefined, IE does not accept either window.clipboardData.setData or event.clipboardData.setData.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question