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

Added a trigger when an item is selected in typeahead. #2388

Closed
wants to merge 1 commit into from
Closed

Added a trigger when an item is selected in typeahead. #2388

wants to merge 1 commit into from

Conversation

mattsonier
Copy link

No description provided.

@max-favilli
Copy link

I like this one, I need that callback too.

@jensenkd
Copy link

awesome..needed this bad!

@nevf
Copy link

nevf commented Mar 18, 2012

Have a look at this fork: https://gist.github.com/1866577. It includes onselect plus other useful enhancements.

@fat
Copy link
Member

fat commented Mar 20, 2012

Can already do this:

$('#myinput').on('change', function (e) { console.log(this.value) })

@fat fat closed this Mar 20, 2012
@nevf
Copy link

nevf commented Mar 20, 2012

The 'onchange' event is problematic in that it fires twice, first when the looses focus and then when the typeahead select is done, both with different values.

Further the code to trigger the change event has for some reason been removed in the latest full download. It is still present in the individual bootstrap-typeahead.js file download.

The specific onselect callback is IMO a far better way to handle this.

Neville

@tlrobinson
Copy link

I'm also seeing a double "change" event when clicking a typeahead suggestion. This seems like a bug?

@thedavidscherer
Copy link

@fat Why was this pull request closed and not merged? Bootstrap still triggers the Change event Twice when using a typeahead. First, the typeahead itself triggers a change on the element, then the default change occurs when the element looses focus.

@cvrebert
Copy link
Collaborator

cvrebert commented Jun 5, 2013

@thedavidscherer The typeahead is now gone, so this is moot anyway. See #7805.

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

Successfully merging this pull request may close these issues.

8 participants