In VS code extension how to make wait, input box is needed to wait until input is given if we click somewhere on screen

Problem:

I have added Quick Pick list drop down to command palette. Now i click on screen anywhere accidently,
Command palette input is skipping to next without taking inputs for current.

Tried:

I have tried by waiting till input is given by await, but it is not stopping.

Expecting:

Command palette should wait till input is given and should not move to next if we click on screen or some other place.