Fix: when pressing a key on the input, the whole selected array is erased