fix tab not working when input string with no selection part.