From: Alexander Ebert Date: Sat, 27 Jul 2019 20:38:59 +0000 (+0200) Subject: Proper handling of click events for smilies X-Git-Tag: 5.2.0_Alpha_4~32 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=5cfa99e5ae90cce373bf65481a6992d4ec0f87b6;p=GitHub%2FWoltLab%2FWCF.git Proper handling of click events for smilies --- diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Smiley/Insert.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Smiley/Insert.js index cccd1340a2..00a945eab4 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Smiley/Insert.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Smiley/Insert.js @@ -80,16 +80,14 @@ define(['EventHandler', 'EventKey'], function (EventHandler, EventKey) { * @protected */ _mousedown: function (event) { - if (!this._container.contains(event.target)) { - return; - } - - event.preventDefault(); - // Clicks may occur on a few different elements, but we are only looking for the image. var listItem = event.target.closest('li'); - var img = elBySel('img', listItem); - if (img) this._insert(img); + if (this._container.contains(listItem)) { + event.preventDefault(); + + var img = elBySel('img', listItem); + if (img) this._insert(img); + } }, /**