From: Alexander Ebert Date: Fri, 1 Feb 2019 23:35:29 +0000 (+0100) Subject: Removed the delay when handling input blur X-Git-Tag: 5.2.0_Alpha_1~318 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=828cfec49bd9cc42efd7fc460bc2ee34c3591074;p=GitHub%2FWoltLab%2FWCF.git 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 --- 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); + } } }; });