following: detect key event as soon as possible

it can happen that we will early return from the keyboard handler
and we will not mark we want to stop following

Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I28ce533b7f3c1d8c189434d0f51e727ca74cb57f
This commit is contained in:
Szymon Kłos 2024-07-11 11:08:15 +02:00 committed by Szymon Kłos
parent 04d15a170e
commit ca5976db0e

View file

@ -451,6 +451,9 @@ L.Map.Keyboard = L.Handler.extend({
return;
}
// if any key is pressed, we stop the following other users
this._map.userList.followUser(this._map._docLayer._viewId);
if (window.KeyboardShortcuts.processEvent(app.UI.language.fromURL, ev)) {
ev.preventDefault();
return;
@ -602,9 +605,6 @@ L.Map.Keyboard = L.Handler.extend({
}
}
// if any key is pressed, we stop the following other users
this._map.userList.followUser(this._map._docLayer._viewId);
L.DomEvent.stopPropagation(ev);
},