From 5b020f31f47793e52e2a86d433f5fb2b5435b2ca Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Wed, 30 Oct 2024 12:27:44 +0300 Subject: [PATCH] Fix click buttons in alt-focus mode --- .../main/lib/controller/ScreenReaderFocus.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/apps/common/main/lib/controller/ScreenReaderFocus.js b/apps/common/main/lib/controller/ScreenReaderFocus.js index e02fc51545..ee7b3caf5a 100644 --- a/apps/common/main/lib/controller/ScreenReaderFocus.js +++ b/apps/common/main/lib/controller/ScreenReaderFocus.js @@ -355,17 +355,17 @@ Common.UI.ScreenReaderFocusManager = new(function() { } else if (e.keyCode == Common.UI.Keys.RETURN || e.keyCode == Common.UI.Keys.SPACE) { if (btn) { if (btn.attr('for')) { // to trigger event in checkbox - $('#' + btn.attr('for')).trigger(jQuery.Event('click', {which: 1})); + (e.keyCode == Common.UI.Keys.RETURN) ? $('#' + btn.attr('for')).trigger(jQuery.Event('click', {which: 1})) : e.preventDefault(); // prevent type space in document } else { - btn.trigger(jQuery.Event('click', {which: 1})); + if (btn.data('tab') === 'file' || isFileMenu && _currentLevel === 1 || isBtnCategory) + btn.trigger(jQuery.Event('click', {which: 1})); + else + setTimeout(function() {btn.trigger(jQuery.Event('click', {which: 1}));}, 1); // click on toolbar buttons } if (btn.data('toggle') !== 'dropdown') btn.blur(); } - if (btn && btn.data('tab') === 'file' || isFileMenu && _currentLevel === 1) { - _nextLevel(); - _setCurrentSection(btn); - } else if (btn && isBtnCategory && btn.hasClass('active')) { - _isSidePanelMode = true; + if (btn && btn.data('tab') === 'file' || isFileMenu && _currentLevel === 1 || isBtnCategory && btn.hasClass('active')) { + (isBtnCategory && btn.hasClass('active')) && (_isSidePanelMode = true); _nextLevel(); _setCurrentSection(btn); } else {