From: Alexander Ebert Date: Mon, 11 Mar 2019 17:04:46 +0000 (+0100) Subject: Merge branch 'next' into next-editor-overhaul X-Git-Tag: 5.2.0_Alpha_1~222^2~2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=4264ff5de137f97ea9fd41fd8113b370712baba7;p=GitHub%2FWoltLab%2FWCF.git Merge branch 'next' into next-editor-overhaul --- 4264ff5de137f97ea9fd41fd8113b370712baba7 diff --cc wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Dropdown/Simple.js index 8b0fbd98d0,2256c2d80d..165b88ac45 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Dropdown/Simple.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Dropdown/Simple.js @@@ -484,24 -482,25 +487,26 @@@ define this._notifyCallbacks(containerId, 'open'); - elAttr(menu, 'role', 'menu'); - elAttr(menu, 'tabindex', -1); - menu.removeEventListener('keydown', _callbackDropdownMenuKeyDown); - menu.addEventListener('keydown', _callbackDropdownMenuKeyDown); + var firstListItem = null; - elBySelAll('li', menu, function(listItem) { - if (firstListItem === null) firstListItem = listItem; - else if (listItem.classList.contains('active')) firstListItem = listItem; - - elAttr(listItem, 'role', 'menuitem'); - elAttr(listItem, 'tabindex', -1); - }); + if (!disableAutoFocus) { + elAttr(menu, 'role', 'menu'); + elAttr(menu, 'tabindex', -1); + menu.removeEventListener('keydown', _callbackDropdownMenuKeyDown); + menu.addEventListener('keydown', _callbackDropdownMenuKeyDown); - var firstListItem = null; + elBySelAll('li', menu, function (listItem) { + if (firstListItem === null) firstListItem = listItem; + else if (listItem.classList.contains('active')) firstListItem = listItem; + + elAttr(listItem, 'role', 'menuitem'); + elAttr(listItem, 'tabindex', -1); + }); - if (firstListItem !== null) { - firstListItem.focus(); - } + } this.setAlignment(dropdown, menu, alternateElement); + + if (firstListItem !== null) { + firstListItem.focus(); + } } }).bind(this));