0
function onkeydown(e) {
if (e.key === "enter")
e.preventDefault()
}
<ReactQuill onKeyDown={onkeydown}/>

Here iam unable to prevent the enter key.

Shiva Sai
  • 54
  • 4

1 Answers1

0

What you are looking for is this.

function onkeydown(e) {
    if (e.keyCode === 13)
    e.preventDefault()
}

Since the keyCode of the Enter key event is 13 }

Nisanth Reddy
  • 5,967
  • 1
  • 11
  • 29