Typeahead control stops responding after item tapped - Mobile Safari
Typeahead control stops responding after item tapped - Mobile Safari

Summary:
Mobile Safari has a strange bug. When the Typeahead control is rendered
within an iframe, once one of the typeahead items is tapped, the input
box stops accepting keypresses. (New characters, as well as keys like
backspace, are ignored). This also affects the Tokenizer control, in
that once one token is chosen, the user cannot type additional tokens.

This seems to be caused by calling e.prevent() within the Mousedown
event of the typeahead items, though it's unclear why. Removing that
line doesn't seem to cause any negative effects - the items lose focus
and are hidden as part of the mousedown.

I also included a fix for a 2nd bug that blocked testing this fix:
the placeholder code currently clears the typeahead contents when it
loses focus, which can result in the loss of user input.

Test Plan:
 1. View typeahead control, rendered within an iframe, on mobile safari.
 2. Begin typing, and tap one of the suggestions.

Reviewers: yungsters, jg, epriestley

Reviewed By: epriestley

CC: phunt, aran, Korvin

Differential Revision: https://secure.phabricator.com/D2762

phacility/javelin,phacility/javelin,phacility/javelin,phacility/javelin,phacility/javelin