Me gustaría restringir el pegado de texto en el contenteditable a texto sin formato. Tengo un archivo html y un archivo ts.
Intenté usar este método pero sigue mostrando este mensaje de error: Property 'clipboardData' does not exist on type 'Event' .
window.onload = function(){ document.querySelector('#divId').addEventListener('paste', (e) => { e.preventDefault(); const text = e.clipboardData.getData('text/plain'); console.log(text); window.document.execCommand('insertText', false, text); }) } <div contenteditable="true" id="divId" style="border: 1px #ebedf2 solid; font-size: 17px; font-weight: 600; font-family: sans-serif; color: #575962;"></div>