Page 1 of 1

Feed tree sidebar unrequested scrolling

Posted: 01 Feb 2012, 18:32
by gmargo
I've been using keys n and p to navigate down and up the article list
within a particular feed. Often when I hit a key, the feed list in
the sidebar does a scrolling action. Since my feed list is long
enough to require a slider, an unexpected scrolling action is obvious
and quite annoying.

I finally tracked down the problem that causes this: keystrokes are
being interpreted twice. Once by the normal tt-rss.js logic, and once
by the dijit.Tree widget that controls the feed list.

It seems that dijit.Tree "helps" us by performing keyboard searching on the
list. It's actually moving the focus on the tree, and performs the
"unrequested scrolling" if the focused-to node is off the screen. ... -searching

So when I hit an 'n' key, the list would scroll to the "Newegg" entry
in my feed list. And when I hit a 'p' key, the list would scroll to
one of many feed entries about Perl, and subsequent 'p' keys would
rotate through all the Perl feed entries in the list.

To make a long story short, to prevent dijit.Tree from unnecessarily
interpreting those keys, I patched FeedTree.js to capture and ignore
keystrokes. This solves my problem, and I can't see any bad side
effects, but there may be a better way to do it.

Code: Select all

--- a/js/FeedTree.js
+++ b/js/FeedTree.js
@@ -94,6 +94,9 @@ dojo.declare("fox.FeedStoreModel", dijit.tree.ForestStoreModel, {
 dojo.declare("fox.FeedTree", dijit.Tree, {
+   _onKeyPress: function(/*Event*/ e){
+      return; // Stop dijit.Tree from interpreting keystrokes
+   },
    _createTreeNode: function(args) {
       var tnode = new dijit._TreeNode(args);

Re: Feed tree sidebar unrequested scrolling

Posted: 02 Feb 2012, 12:40
by fox
Good idea, fixed in trunk. Thanks.