From 21b17e80972479072fe3886cd140f26d3db67dd7 Mon Sep 17 00:00:00 2001 From: Fernando Date: Wed, 1 Jul 2020 13:22:56 +0200 Subject: [PATCH] Focus contextbutton after update if focused beforehand Co-authored-by: Dmitry Lyzo <56478732+dmitrylyzo@users.noreply.github.com> --- src/components/remotecontrol/remotecontrol.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/components/remotecontrol/remotecontrol.js b/src/components/remotecontrol/remotecontrol.js index 655761d93..e23051870 100644 --- a/src/components/remotecontrol/remotecontrol.js +++ b/src/components/remotecontrol/remotecontrol.js @@ -178,9 +178,13 @@ define(['browser', 'datetime', 'backdrop', 'libraryBrowser', 'listView', 'imageL let contextButton = context.querySelector('.btnToggleContextMenu'); // We remove the previous event listener by replacing the item in each update event + const autoFocusContextButton = document.activeElement === contextButton; let contextButtonClone = contextButton.cloneNode(true); contextButton.parentNode.replaceChild(contextButtonClone, contextButton); contextButton = context.querySelector('.btnToggleContextMenu'); + if (autoFocusContextButton) { + contextButton.focus(); + } var options = { play: false, queue: false,