Fix handling space

When the autocomplete is open, pressing the spacebar should close it.