Enter key behavior not working as expected in React onKeyDown event

50 Views Asked by At

In my React application inside the text editor I have this code snippet:

onKeyDown={(e) => {
   console.log("e.code: ", e.code);
}}

When I hold **ShiftLeft **and then press **Enter **you then can see in logs that ShiftLeft, Enter are printed. What I do not understand is that when I do exactly the same but while holding ControlLeft, the Enter is not printed.

I tried trying out different browsers on my windows but it is the same, on MacBook it works properly. What could be the issue?

0

There are 0 best solutions below