From 8c129abb56d157e2d956b64902a1fe3cc974c898 Mon Sep 17 00:00:00 2001 From: Erik Strid Date: Tue, 19 Nov 2024 10:14:17 +0100 Subject: [PATCH] Fix tab glitch when tabing from and to an autocomplete field, which resulted in a dropdown that didn't open on first character when returning to the field (#1039) Co-authored-by: Erik Strid (cherry picked from commit e7d049b6df62e51e979beaa2982253c3d3f07daa) --- .../ajax/markup/html/autocomplete/wicket-autocomplete.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/autocomplete/wicket-autocomplete.js b/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/autocomplete/wicket-autocomplete.js index 70415e395e..be20fc1652 100644 --- a/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/autocomplete/wicket-autocomplete.js +++ b/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/autocomplete/wicket-autocomplete.js @@ -102,7 +102,11 @@ //workaround for IE. Clicks on scrollbar trigger //'blur' event on input field. (See https://issues.apache.org/jira/browse/WICKET-5882) if (menuId !== document.activeElement.id && (menuId + "-container") !== document.activeElement.id) { - hideAutoCompleteTimer = window.setTimeout(hideAutoComplete, 500); + hideAutoCompleteTimer = window.setTimeout(function() { + hideAutoComplete(); + isTriggeredChange = false; + triggerChangeOnHide = false; + }, 500); } else { jQuery(this).trigger("focus"); }