Fixed exception when entering a new item.

If you entered something that caused the dropdown to appear with options, and then continued typing until it was a new item, pressing Enter would throw an exception and cause the form to be submitted.