twitter/bootstrap — pull request #6822 by blakeembrey (2013-02-06 22:58:30+00:00)
Title: Typeahead updates

This is to reopen my previous PR from #6487

**Typeahead updater**

Small change so that if the typeahead updater returns undefined it will no longer wipe out the input value. This allows much greater flexibility to work with the typeahead updater.

**Typeahead container**

The new insertAfter method for typeaheads is creating issues inside control groups and other things that rely on `:last-child` selectors. Added the container option which matches the tooltip implementation.

**Use case**

On http://letushelp.net.au/join/ we are required to have separate input fields for each of the address fields. Since the typeahead and backend is giving full strings, it is split up between input fields in the typeahead updater function. Since the input field could be any that initiated the function, it doesn't take into account which input field is currently active and is already set during the updater function. Returning nothing at the end wipes out the previously inserted value.

The typeahead container is required in the same instances the tooltip container was required. Since it now uses `insertAfter` it breaks pseudo CSS selectors and sibling selectors found in Bootstrap, such as found in the control group.