JS-incorrect judgment of deletion events caused by input method

<input id="app"/>


$("-sharpapp").on("keydown",function(even){
    if(even.KeyCode==8){
        console.log("")
    }

})

as shown in the code above, an event will be triggered when I press delete backspace in the input box. But when I am typing in Chinese, pressing the backspace key will still trigger this event if I make a misspelling. how to solve it? I don"t want the event to be triggered by pressing backspace on the way to Chinese spelling.

solved, thank you. Please


chrome 70 does not reproduce


compositionstart, compositionend events. Do not use keydown directly

Menu