Fixes #5245: Prevent selecting all items when searching.