a JS module to control tab key behavior dynamically