From 3074b97f4343e5489f93a6961ed132f6e7eb3b40 Mon Sep 17 00:00:00 2001 From: Neil Drumm Date: Fri, 29 Dec 2006 07:20:26 +0000 Subject: #86384 by AjK and Steve McKenzie. Catch backspace in autocomplete fields. --- misc/autocomplete.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/misc/autocomplete.js b/misc/autocomplete.js index abdf6342e..593fb5e0a 100644 --- a/misc/autocomplete.js +++ b/misc/autocomplete.js @@ -195,6 +195,11 @@ Drupal.jsAC.prototype.populatePopup = function () { * Fills the suggestion popup with any matches received */ Drupal.jsAC.prototype.found = function (matches) { + // If no value in the textfield, do not show the popup. + if (!this.input.value.length) { + return false; + } + // Prepare matches var ul = document.createElement('ul'); var ac = this; -- cgit v1.2.3