Closed gunnx closed 8 years ago
@gunnx Thanks for the input. Since 1.2, Autotab has been doing this very thing. It will ignore the tab key (once) for 800 milliseconds so that it doesn't tab two elements over. If you're seeing a different behavior, can you give me a little more info to work with?
@Mathachew Hi Matthew, not that's fine, its more a different behaviour, this option would disable autotabbing permanently as soon as TAB key is pressed.
You should be able to do this without changing anything in Autotab with something like this (untested):
$('.number').on('keydown', function (e) {
var keyCode = e.which || e.charCode;
// When TAB is pressed, turn off Autotab
if (keyCode == 9) $.autotab.remove();
});
By not passing a value to remove, it would turn off Autotab on all fields. See here for more info.
@Mathachew thanks, yes that could do the job. Happy for you to close this.
Glad to help!
For those people who use keyboard as primary input device, they would normally press TAB to advance to next field, with autotab in action this can confuse things, so could add option to check for TAB key presses which then turn off autotabbing.