Make sure the typeahead item is a string

Fixes #6410

Simple check to make sure the value of the item is a string before try to use the toLowerCase() method so we don't cause errors. Added a simple test case.