From: Alexander Ebert Date: Tue, 23 Aug 2016 10:34:10 +0000 (+0200) Subject: Fixed mention dropdown behaving strangely X-Git-Tag: 3.0.0_Beta_1~577 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b185d6184afaf8fe976e15dd87feab73102524d2;p=GitHub%2FWoltLab%2FWCF.git Fixed mention dropdown behaving strangely --- diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Redactor/Mention.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Redactor/Mention.js index 11cc32de5b..9e4c3091ab 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Redactor/Mention.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Redactor/Mention.js @@ -1,4 +1,3 @@ -define(['Ajax', 'Environment', 'EventHandler', 'Ui/Alignment'], function(Ajax, Environment, EventHandler, UiAlignment) { "use strict"; var _dropdownContainer = null; @@ -18,6 +17,8 @@ define(['Ajax', 'Environment', 'EventHandler', 'Ui/Alignment'], function(Ajax, E redactor.WoltLabEvent.register('keydown', this._keyDown.bind(this)); redactor.WoltLabEvent.register('keyup', this._keyUp.bind(this)); + + UiCloseOverlay.add('UiRedactorMention-' + redactor.core.element()[0].id, this._hideDropdown.bind(this)); }, _keyDown: function(data) { @@ -64,6 +65,15 @@ define(['Ajax', 'Environment', 'EventHandler', 'Ui/Alignment'], function(Ajax, E return; } + if (this._dropdownActive) { + data.cancel = true; + + // ignore arrow up/down + if (event.which === 38 || event.which === 40) { + return; + } + } + var text = this._getTextLineInFrontOfCaret(); if (text.length) { var match = text.match(/@([^,]{3,})$/);