Skip to content

Commit eb39700

Browse files
authored
Merge pull request webdevcody#683 from bruno-queiroz/639-fix-dead-keys-problem
webdevcody#639 Fix Dead keys problem
2 parents 0eca09d + 335374d commit eb39700

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

packages/app/src/app/race/_components/race/race-practice.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { saveUserResultAction } from "../../actions";
77
// utils
88
import { calculateAccuracy, calculateCPM, noopKeys } from "./utils";
99

10-
// Componenets
10+
// Components
1111
import Code from "./code";
1212
import Footer from "./footer";
1313
import Header from "./header";
@@ -38,7 +38,7 @@ export default function RacePractice({ user, snippet }: RacePracticeProps) {
3838
const router = useRouter();
3939
const isRaceFinished = input === code;
4040

41-
const isUserOnAdroid = useCheckForUserNavigator("android");
41+
const isUserOnAndroid = useCheckForUserNavigator("android");
4242

4343
useEffect(() => {
4444
localStorage.removeItem("chartTimeStamp");
@@ -94,10 +94,10 @@ export default function RacePractice({ user, snippet }: RacePracticeProps) {
9494
}
9595
}
9696
});
97-
97+
9898
// eslint-disable-next-line @typescript-eslint/no-explicit-any
99-
function handleInputEvent(e: any) {
100-
if (!isUserOnAdroid) return;
99+
function handleInputEvent(e: any /** React.FormEvent<HTMLInputElement>*/) {
100+
if (!isUserOnAndroid) return;
101101
if (!startTime) {
102102
setStartTime(new Date());
103103
}
@@ -123,7 +123,7 @@ export default function RacePractice({ user, snippet }: RacePracticeProps) {
123123
// For ANDROID.
124124
// since the enter button on a mobile keyboard/keypad actually
125125
// returns a e.key of "Enter" onkeydown, we just set a condition for that.
126-
if (isUserOnAdroid) {
126+
if (isUserOnAndroid) {
127127
switch (e.key) {
128128
case "Enter":
129129
if (!startTime) {

packages/app/src/app/race/_components/race/utils.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ export const noopKeys = [
1919
"Tab",
2020
"ArrowRight",
2121
"ArrowLeft",
22+
"Dead",
2223
];
2324

2425
export function calculateCPM(

0 commit comments

Comments
 (0)