fix edge case for tab and shift tab input navigation