function onkeydown(e) {
if (e.key === "enter")
e.preventDefault()
}
<ReactQuill onKeyDown={onkeydown}/>
Here iam unable to prevent the enter key.
function onkeydown(e) {
if (e.key === "enter")
e.preventDefault()
}
<ReactQuill onKeyDown={onkeydown}/>
Here iam unable to prevent the enter key.
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
}