Search field bug

I have a search field in my application. As I type into it, it shows all
available entries. But when I delete what I typed, instead of showing
all
entries, it shows nothing. How can I fix this?