Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typeahead menu appendToBody -> insertAfterElement #3145

Closed
wants to merge 1 commit into from
Closed

Typeahead menu appendToBody -> insertAfterElement #3145

wants to merge 1 commit into from

Conversation

willem403
Copy link

Changes:

  • Keeps the dynamic typeahead-menu HTML-code close to the input-field.
  • Provides an option to use the old method, just in case.

Advantages:

  • Easier unload typeahead-menu dynamically.
  • Properties applied to the input-field will also effect the typeahead-menu e.g styling.
  • Easier to ascertain the input-field's menu when using multiple typeahead menu's on the same page.

Usage:
.typeahead({source: source})​;​

AppendToBody Usage:
.typeahead({source: source, appendToBody: true})​;​

PS: Sorry for the long commit message. This is my first time using github's web interface to send a pull request.

… element". Incase there is need to use appendToBody I provided an option to use it, I see no use for appendToBody.
@fat
Copy link
Member

fat commented Apr 26, 2012

not crazy about this - doesn't seem to provide enough value to warrant an option.

@fat fat closed this Apr 26, 2012
@willem403
Copy link
Author

The option is over doing it, yes. On the other hand ".insertAfter(this.$element)" instead of ".appendTo('body')" is needed IMHO. It also relates to issue 3088. Please let me know if I should send another push request without the option.

@snrmwg
Copy link

snrmwg commented May 25, 2012

I agree with willem403. Fix without option should be fine.
+1 for pulling this into next version

@mlhch
Copy link

mlhch commented Jun 17, 2013

There is one case that ".appendTo('body')" is better that ".insertAfter(this.$element)", that when it is used in a WordPress plugin, the class="typeahead dropdown-menu" can be easily overrided by other css rules. So I have to use '!important' or do something else.

What's your opinion?

@cvrebert
Copy link
Collaborator

The Bootstrap Typeahead has been removed in v3 per #7805.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants