Mention popup focus fix

Previously it used span elements to focus popup listbox.
Now the listbox itself takes focus because entries
don't have tabindex anymore so they are not selected
when tab key is pressed

Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I5ef87cf1717b1249994bbf435fa9a55738c81a12
This commit is contained in:
Szymon Kłos 2023-04-14 17:34:05 +02:00 committed by Szymon Kłos
parent ebbcd13a62
commit 847ade2422

View file

@ -906,9 +906,9 @@ L.TextInput = L.Layer.extend({
var mentionPopup = L.DomUtil.get('mentionPopup');
if (mentionPopup) {
if (ev.key === 'ArrowDown') {
var initialFocusElement =
document.querySelector('#mentionPopup span[tabIndex="0"]');
var initialFocusElement = document.querySelector('#mentionPopup span');
if (initialFocusElement) {
initialFocusElement.tabIndex = 0;
initialFocusElement.focus();
ev.preventDefault();
ev.stopPropagation();