From 4a2a90c980bb7436150ed82556fdb6f4db3ff138 Mon Sep 17 00:00:00 2001 From: Michael Kuhn Date: Sun, 7 Apr 2019 12:21:52 +0200 Subject: Fix focus issues with hotkeys Since making use of keypress in addition to keydown, hotkeys did not work in certain scenarios, including clicking on the feed tree expanders or empty spaces of the toolbar. This issue is caused by dijit.Tree and dijit.Toolbar implementing the _KeyNavMixin, which explicitly stops propagation of keypress events. This change contains two main fixes plus a smaller hotfix: 1. It overrides _onContainerKeydown and _onContainerKeypress for fox.FeedTree (which inherits from dijit.Tree). 2. It adds fox.Toolbar, which overrides _onContainerKeydown, _onContainerKeypress and focus. This fixes hotkeys being swallowed and the first focusable child receiving focus when clicking on an empty space of the toolbar. 3. It adds the same handling of keydown and keypress to the prefs hotkey handler as is done in the main hotkey handler. --- js/tt-rss.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'js/tt-rss.js') diff --git a/js/tt-rss.js b/js/tt-rss.js index eaedecd22..5db742f07 100644 --- a/js/tt-rss.js +++ b/js/tt-rss.js @@ -54,7 +54,8 @@ require(["dojo/_base/kernel", "fox/Headlines", "fox/Article", "fox/FeedStoreModel", - "fox/FeedTree"], function (dojo, declare, ready, parser, AppBase) { + "fox/FeedTree", + "fox/Toolbar"], function (dojo, declare, ready, parser, AppBase) { ready(function () { try { @@ -203,7 +204,7 @@ require(["dojo/_base/kernel", isCombinedMode: function() { return App.getInitParam("combined_display_mode"); }, - hotkeyHandler(event) { + hotkeyHandler: function(event) { if (event.target.nodeName == "INPUT" || event.target.nodeName == "TEXTAREA") return; // Arrow buttons and escape are not reported via keypress, handle them via keydown. -- cgit v1.2.3 From e38fcd6deac9a63654fb0eb61fffa9ad747e4c50 Mon Sep 17 00:00:00 2001 From: Michael Kuhn Date: Sat, 13 Apr 2019 22:36:15 +0200 Subject: Fix button focus issues This change introduces derived classes for ComboButton, DropDownButton and Select that make sure that buttons do not remain focused after their menus are closed. This allows using hotkeys after closing them. --- js/tt-rss.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'js/tt-rss.js') diff --git a/js/tt-rss.js b/js/tt-rss.js index 5db742f07..bf0434a95 100644 --- a/js/tt-rss.js +++ b/js/tt-rss.js @@ -55,7 +55,10 @@ require(["dojo/_base/kernel", "fox/Article", "fox/FeedStoreModel", "fox/FeedTree", - "fox/Toolbar"], function (dojo, declare, ready, parser, AppBase) { + "fox/Toolbar", + "fox/form/Select", + "fox/form/ComboButton", + "fox/form/DropDownButton"], function (dojo, declare, ready, parser, AppBase) { ready(function () { try { -- cgit v1.2.3