From 397a1b9616c55bd9afd9737e05e9df633fd8a6c7 Mon Sep 17 00:00:00 2001 From: Nagesh Dhope Date: Fri, 15 Nov 2019 11:31:19 +0530 Subject: [PATCH] Fix main window tab navigation accessibility issue: 1) Dashboard -> Server Activity grid: terminate the session, cancel active button not navigable using tab key. 2) SQL -> If the focus inside code mirror control tab navigation not working. Fixes #4930 --- docs/en_US/release_notes_4_16.rst | 1 + web/pgadmin/browser/static/js/keyboard.js | 2 +- web/pgadmin/dashboard/static/js/dashboard.js | 7 +++++++ web/pgadmin/static/bundle/codemirror.js | 12 ++++++++++++ web/pgadmin/static/scss/_pgadmin.style.scss | 4 ++++ 5 files changed, 25 insertions(+), 1 deletion(-) diff --git a/docs/en_US/release_notes_4_16.rst b/docs/en_US/release_notes_4_16.rst index 907964090..427a7b81f 100644 --- a/docs/en_US/release_notes_4_16.rst +++ b/docs/en_US/release_notes_4_16.rst @@ -19,5 +19,6 @@ Bug fixes | `Issue #4792 `_ - Ensure that the superuser should be able to create database, as the superuserĀ overrides all the access restrictions. | `Issue #4878 `_ - Ensure that the superuser should be able to create role, as the superuserĀ overrides all the access restrictions. +| `Issue #4930 `_ - Fix main window tab navigation accessibility issue. | `Issue #4934 `_ - Fix the help button link on the User Management dialog. | `Issue #4935 `_ - Fix accessibility issues. diff --git a/web/pgadmin/browser/static/js/keyboard.js b/web/pgadmin/browser/static/js/keyboard.js index 9a21c24d0..8b85ecefc 100644 --- a/web/pgadmin/browser/static/js/keyboard.js +++ b/web/pgadmin/browser/static/js/keyboard.js @@ -134,7 +134,7 @@ _.extend(pgBrowser.keyboardNavigation, { bindRightPanel: function(event, combo) { let allPanels = pgAdmin.Browser.docker.findPanels(); let activePanel = 0; - let nextPanel = allPanels.length; + let nextPanel = allPanels.length - 1; let prevPanel = 1; let activePanelId = 0; let activePanelFlag = false; diff --git a/web/pgadmin/dashboard/static/js/dashboard.js b/web/pgadmin/dashboard/static/js/dashboard.js index 39132dd52..42d2eca4b 100644 --- a/web/pgadmin/dashboard/static/js/dashboard.js +++ b/web/pgadmin/dashboard/static/js/dashboard.js @@ -52,6 +52,13 @@ define('pgadmin.dashboard', [ '\'>' ); } + this.$el.attr('tabindex', 0); + this.$el.on('keydown', function(e) { + // terminating session or cancel the active query. + if (e.keyCode == 32) { + self.$el.click(); + } + }), this.delegateEvents(); return this; }, diff --git a/web/pgadmin/static/bundle/codemirror.js b/web/pgadmin/static/bundle/codemirror.js index b77c259e7..614fdc32f 100644 --- a/web/pgadmin/static/bundle/codemirror.js +++ b/web/pgadmin/static/bundle/codemirror.js @@ -26,4 +26,16 @@ import 'codemirror/addon/comment/comment'; import 'sources/codemirror/addon/fold/pgadmin-sqlfoldcode'; import 'sources/codemirror/extension/centre_on_line'; +var cmds = CodeMirror.commands; +cmds.focusOut = function(){ + event.stopPropagation(); + document.activeElement.blur(); + if(event.currentTarget.parents().find('.sql-code-control')) { + // for code mirror in dialogs + event.currentTarget.parents().find('.sql-code-control').focus(); + } +}; + +CodeMirror.keyMap.default['Esc'] = 'focusOut'; + export default CodeMirror; diff --git a/web/pgadmin/static/scss/_pgadmin.style.scss b/web/pgadmin/static/scss/_pgadmin.style.scss index c87fa4d48..e6e4dabb9 100644 --- a/web/pgadmin/static/scss/_pgadmin.style.scss +++ b/web/pgadmin/static/scss/_pgadmin.style.scss @@ -626,6 +626,10 @@ fieldset.inline-fieldset > div { height: 100%; } + & .btn-secondary:focus { + box-shadow: $input-btn-focus-box-shadow; + } + & .input-group { & .input-group-text { background: $input-bg;