JSFiddle - React, Tailwind, and code Playground
HTML
<div id="editor" contentEditable="true">editor</div>
CSS
#editor{
width:300px;
height:300px;
border: 1px solid black;
}
JavaScript
var elEditor = document.getElementById("editor");
elEditor.addEventListener('beforecopy', function(e){
console.log('beforecopy');
e.preventDefault();
e.stopPropagation();
});
elEditor.addEventListener('copy', function(e){
console.log('copy');
e.preventDefault();
e.stopPropagation();
});
elEditor.addEventListener('beforepaste', function(e){
console.log('beforepaste');
e.preventDefault();
e.stopPropagation();
});
elEditor.addEventListener('paste', function(e){
console.log('paste')
});