From 6e361a5531f722b6459e827f20a2a11d9039d7a5 Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Sat, 27 Aug 2022 22:45:26 +0200 Subject: [PATCH] =?UTF-8?q?Ne=20pas=20raffra=C3=AEchir=20si=20le=20text=20?= =?UTF-8?q?ne=20change=20pas?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- module/actor-sheet.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/module/actor-sheet.js b/module/actor-sheet.js index 09f497c9..d8bd89d6 100644 --- a/module/actor-sheet.js +++ b/module/actor-sheet.js @@ -432,14 +432,17 @@ export class RdDActorSheet extends ActorSheet { } }) .keyup(async event => { - this.options.recherche = this._optionRecherche(event.currentTarget) - if (this.timerRecherche) { - clearTimeout(this.timerRecherche); + const nouvelleRecherche = this._optionRecherche(event.currentTarget); + if (this.options.recherche?.text != nouvelleRecherche?.text){ + this.options.recherche = nouvelleRecherche; + if (this.timerRecherche) { + clearTimeout(this.timerRecherche); + } + this.timerRecherche = setTimeout(() => { + this.timerRecherche = undefined; + this.render(true); + }, 500); } - this.timerRecherche = setTimeout(() => { - this.timerRecherche = undefined; - this.render(true); - }, 500); }) .change(async event => this.options.recherche = this._optionRecherche(event.currentTarget)