Thursday 24 September 2020

get copied content inside onCopy hook (plugin)

I am trying to get copied fragment into onCopy hook vainly.

I've been trying with the event.clipboardData...

const { clipboardData } = event;
const encoded = clipboardData.getData("application/x-slate-fragment");

But it seems as empty. I have also tried with the getEventTransfer utils. But it returns {type: 'unknow'}

Here is the CodeSandBox that I have been testing.



from get copied content inside onCopy hook (plugin)

No comments:

Post a Comment