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 prevents focus callbacks #7269
Comments
@cthielen I agree that the behavior should be overridable using the passed in var typeahead = control.typeahead({ /* ... */}).data('typeahead');
control.off('focus').on('focus', function() {
control.select();
// maintain current behavior
typeahead.focused = true;
}); |
I'm not sure that works: http://jsfiddle.net/tUbXL/ |
Interesting. I hadn't tested my example, although the jsfiddle seems to work in IE10, but not in Chrome when clicking directly; it works in Chrome if you add some On a related note, even when it is working, the behavior feels odd to me. Ignoring my feelings on the feature, I agree that |
Punting on this. We've dropped bootstrap-typeahead.js in v3 (see 88dd9de) in favor of folks using Twitter's typeahead. <3 |
I'd like to select all text when a typeahead field is focused but Bootstrap is currently preventing this in both 2.x and 3.0.
The UX theory is that if typeahead makes it easy to search through lists by typing, the user may want to make changes just as quickly and we should be able to $.select() the text on focus to automatically erase the field's contents when they type something new.
This isn't good default behavior, but I don't know the use case for Typeahead to block focus events.
The text was updated successfully, but these errors were encountered: