Avoid setting the results to undefined in newSearch
Enter Rosa
, select Rosa del Peru (Type 1)
, end press <Enter>
Results are OK.
Remove a parenthesis, the select box appears again. Select once again Rosa del Peru (Type 1)
and hit <Enter>
: The results disappear.
This is because the results are cleared in newSearch()
, but this method navigates to the same URL as before, and the queryParamMap observable thus doesn't emit anything, and a new query thus isn't emitted.
This thus has nothing to do with suggestions. We should clear the results in the queryParamMap observable pipes, if we detect that the query has changed, and not in newSearch.