fixes #3011 Tab key does not work when adding categories

fixed the issue and committed code for review, please check it.