2.4 Sampler: Tabbing through inputs no longer works

My searches didn't turn anything up, so I hope this is not by design, but keyboard tabbing in Firefox 29 / Chrome 35 is no longer enabled by default in the 2.4.0 sampler (5/25/14). I'm not sure at what version this disappeared, but it is possible to tab from one input to the next in the 2.2.0 sample whether loaded inside the entire sampler:
enyojs.com/sampler/2.2.0/
...or loading the stand-alone sample page
enyojs.com/sampler/2.2.0/lib/onyx/samples/InputSample.html

In the 2.4.0 sampler, keyboard tabbing only works using the stand-alone samples for base-Enyo and Onyx:
enyojs.com/sampler/2.4.0/enyo/samples/InputSample.html
enyojs.com/sampler/2.4.0/lib/onyx/samples/InputSample.html
...but in the full sampler app tabbing though inputs no longer works:
enyojs.com/sampler/2.4.0/

Is there a way to re-enable tabbing in the Sampler app?
This seems it may be a gotcha I'd want to know how to avoid.
-Thanks

Comments

  • This is due to spotlight.

    I ran into this making an app for desktop use.

    This is in lib/spotlight/enyo.Spotlight.js
    I changed the function to check the tag name:
    enyo.Spotlight._isIgnoredKey = function(oEvent) {
    			var oOriginator = enyo.$[oEvent.target.id];
    			if (oOriginator && oOriginator.spotlightIgnoredKeys) {
    				var aKeys = oOriginator.spotlightIgnoredKeys;
    				if (!enyo.isArray(aKeys)) {
    					aKeys = [aKeys];
    				}
    				if (enyo.indexOf(oEvent.keyCode, aKeys) > -1) {
    					return true;
    				}
    			}
    			if (oEvent.target.tagName == "INPUT") {return true;}
    			return false;
    		};
    Basically, on a tab key press, it is preventing it from bubbling and trying to do a spotlight action.
  • Great to know - Thanks for the quick explanation!
    I don't see any need for the Spotlight lib, so from your explanation it looks like I will get the Sampler 2.2.0 behavior I want if I just stick to the base bootplate and don't bring in Spotlight.
    Very helpful info, thanks!
  • There is another spot in moonstone that disables the tab key as well,

    in MoonScrollStrategy.js, at the bottom it pushes this feature to the dispather:
    enyo.dispatcher.features.push(function(e) {
    	if ((e.type == "keydown") && (e.keyCode == 9)) {
    		e.preventDefault();
    	}
    });
    So it prevents all tabs.

    I changed it to this:
    enyo.dispatcher.features.push(function(e) {
    	if ((e.type == "keydown" && enyo.platform.webos) && (e.keyCode == 9)) {
    		e.preventDefault();
    	}
    });
Sign In or Register to comment.