From 12d18fa46c81d2ddedcd825f61bea925d6472fd8 Mon Sep 17 00:00:00 2001 From: barredterra <14891507+barredterra@users.noreply.github.com> Date: Mon, 20 May 2024 15:54:26 +0200 Subject: [PATCH] perf: undebounce autocomplete --- .../js/frappe/form/controls/autocomplete.js | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/frappe/public/js/frappe/form/controls/autocomplete.js b/frappe/public/js/frappe/form/controls/autocomplete.js index 344320c468..beb951a567 100644 --- a/frappe/public/js/frappe/form/controls/autocomplete.js +++ b/frappe/public/js/frappe/form/controls/autocomplete.js @@ -90,16 +90,13 @@ frappe.ui.form.ControlAutocomplete = class ControlAutoComplete extends frappe.ui $(this.input_area).find(".awesomplete ul").css("min-width", "100%"); - this.$input.on( - "input", - frappe.utils.debounce((e) => { - if (this.get_query || this.df.get_query) { - this.execute_query_if_exists(e.target.value); - } else { - this.awesomplete.list = this.get_data(); - } - }, 500) - ); + this.$input.on("input", (e) => { + if (this.get_query || this.df.get_query) { + this.execute_query_if_exists(e.target.value); + } else { + this.awesomplete.list = this.get_data(); + } + }); this.$input.on("focus", () => { if (!this.$input.val()) {