Fix cursor position when navigate with up/down in palette input