From f32ee015c40f552152a93ca892cbd7305ee45950 Mon Sep 17 00:00:00 2001 From: Pedro Bustamante <92451773+pedrobusta@users.noreply.github.com> Date: Sat, 6 Apr 2024 18:26:31 +0200 Subject: [PATCH] changed keyup to onInput event improves performance --- 03-midu-typing-game/index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/03-midu-typing-game/index.html b/03-midu-typing-game/index.html index 83e5488..557c107 100644 --- a/03-midu-typing-game/index.html +++ b/03-midu-typing-game/index.html @@ -230,7 +230,7 @@

} }) $input.addEventListener('keydown', onKeyDown) - $input.addEventListener('keyup', onKeyUp) + $input.addEventListener('input', onInput) $button.addEventListener('click', initGame) } @@ -293,7 +293,7 @@

} } - function onKeyUp() { + function onInput() { // recuperamos los elementos actuals const $currentWord = $paragraph.querySelector('word.active') const $currentLetter = $currentWord.querySelector('letter.active')