From 828cfec49bd9cc42efd7fc460bc2ee34c3591074 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Sat, 2 Feb 2019 00:35:29 +0100 Subject: [PATCH] Removed the delay when handling input blur The timeout was required due to a duplication issue caused by the parallel handling of the click event on a suggestion and the blur event as a side effect of the click. Original change: c75b69cc51639120091243b9c808243a8f747d10 --- .../files/js/WoltLabSuite/Core/Ui/ItemList.js | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/ItemList.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/ItemList.js index 638fd3e1d0..fde6aef242 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/ItemList.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/ItemList.js @@ -543,21 +543,19 @@ define(['Core', 'Dictionary', 'Language', 'Dom/Traverse', 'EventKey', 'WoltLabSu * @param {object} event event object */ _blur: function(event) { - var data = _data.get(event.currentTarget.id); + var input = event.currentTarget; + var data = _data.get(input.id); if (data.options.restricted) { // restricted item lists only allow results from the dropdown to be picked return; } - var currentTarget = event.currentTarget; - window.setTimeout(function() { - var value = currentTarget.value.trim(); - if (value.length) { - if (!data.suggestion || !data.suggestion.isActive()) { - this._addItem(currentTarget.id, { objectId: 0, value: value }); - } + var value = input.value.trim(); + if (value.length) { + if (!data.suggestion || !data.suggestion.isActive()) { + this._addItem(input.id, { objectId: 0, value: value }); } - }.bind(this), 100); + } } }; }); -- 2.20.1