Modify to avoid to blur while composing (#775)

This commit is contained in:
Sosuke Suzuki 2020-02-17 17:44:08 +09:00 committed by GitHub
parent c4dbb7ca45
commit 2bb95f0651
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -25,6 +25,9 @@ export class ProjectName extends Component<Props> {
private handleKeyDown = (e: React.KeyboardEvent<HTMLElement>) => { private handleKeyDown = (e: React.KeyboardEvent<HTMLElement>) => {
if (e.key === "Enter") { if (e.key === "Enter") {
e.preventDefault(); e.preventDefault();
if (e.nativeEvent.isComposing || e.keyCode === 229) {
return;
}
e.currentTarget.blur(); e.currentTarget.blur();
} }
}; };