Fixes search when entering an empty string or when dismissing the search
dialog.