fix up/down on inputs when cursor is at the rightmost position