From 902d182fbf894efdfca255f6a00134268e975b2d Mon Sep 17 00:00:00 2001 From: JonathanMM Date: Wed, 12 Jan 2022 08:34:06 +0100 Subject: [PATCH] =?UTF-8?q?Correction=20d'un=20probl=C3=A8me=20avec=20le?= =?UTF-8?q?=20retour=20arri=C3=A8re=20sur=20safari?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ts/dictionnaire.ts | 2 +- ts/input.ts | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/ts/dictionnaire.ts b/ts/dictionnaire.ts index 2925778..2c3b2dc 100644 --- a/ts/dictionnaire.ts +++ b/ts/dictionnaire.ts @@ -9,7 +9,7 @@ export default class Dictionnaire { let numeroGrille = Math.floor((aujourdhui - origine) / (24 * 3600 * 1000)); - return MotsATrouver.Liste[numeroGrille]; + return MotsATrouver.Liste[numeroGrille % MotsATrouver.Liste.length]; } public estMotValide(mot: string): boolean { diff --git a/ts/input.ts b/ts/input.ts index 6fefcf7..6571886 100644 --- a/ts/input.ts +++ b/ts/input.ts @@ -27,17 +27,15 @@ export default class Input { if (touche === "Enter") { this.validerMot(); - } else if (touche === "Backspace") { - this.effacerLettre(); } else { this.saisirLettre(touche); } }).bind(this) ); - // Le retour arrière n'est détecté que par keyup + // Le retour arrière n'est détecté que par keydown document.addEventListener( - "keyup", + "keydown", ((event: KeyboardEvent) => { event.stopPropagation(); let touche = event.key;