From 664faacde8acadde17fb955177684001e45941b2 Mon Sep 17 00:00:00 2001 From: daria Date: Mon, 8 Jan 2024 15:22:27 +0200 Subject: [PATCH] focus is set on the buttons #1284 --- www/common/common-interface.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/www/common/common-interface.js b/www/common/common-interface.js index 1a662c4a5..597574841 100644 --- a/www/common/common-interface.js +++ b/www/common/common-interface.js @@ -1480,14 +1480,23 @@ define([ $button.addClass('cp-toolbar-button-active'); var wh = $(window).height(); $content.css('max-height', Math.floor(wh - topPos - 1)+'px') - $content.children(':visible').addClass('active-element'); + $content.children(':visible').each(function() { + if ($(this).is('button')) { + $(this).addClass('active-element'); + } else if ($(this).find('button').length > 0) { + $(this).find('button').addClass('active-element'); + } + }); $content.find('.active-element').first().focus(); } else { - $content.children().removeClass('active-element'); + if ($(this).is('button')) { + $(this).removeClass('active-element'); + } else if ($(this).find('button').length > 0) { + $(this).find('button').removeClass('active-element'); + } } }); - var currentIndex = 0; $(document).keydown(function(e) {