In my case this helped me
if (event.key === 'Enter' && !event.shiftKey) { event.preventDefault(); document.execCommand('insertLineBreak'); return; }