summaryrefslogtreecommitdiff
path: root/js/Toolbar.js
diff options
context:
space:
mode:
authorMichael Kuhn <[email protected]>2019-04-07 12:21:52 +0200
committerMichael Kuhn <[email protected]>2019-04-13 22:34:57 +0200
commit4a2a90c980bb7436150ed82556fdb6f4db3ff138 (patch)
treef30bf3f5c20c58ccb0cddc5c2815ec4befd22c44 /js/Toolbar.js
parent7e55340295d7c3f7d1fded0c8d07700b908b57f2 (diff)
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.
Diffstat (limited to 'js/Toolbar.js')
-rwxr-xr-xjs/Toolbar.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/js/Toolbar.js b/js/Toolbar.js
new file mode 100755
index 000000000..6d2c20058
--- /dev/null
+++ b/js/Toolbar.js
@@ -0,0 +1,14 @@
+/* global dijit */
+define(["dojo/_base/declare", "dijit/Toolbar"], function (declare) {
+ return declare("fox.Toolbar", dijit.Toolbar, {
+ _onContainerKeydown: function(/* Event */ e) {
+ return; // Stop dijit.Toolbar from interpreting keystrokes
+ },
+ _onContainerKeypress: function(/* Event */ e) {
+ return; // Stop dijit.Toolbar from interpreting keystrokes
+ },
+ focus: function() {
+ return; // Stop dijit.Toolbar from focusing the first child on click
+ },
+ });
+});