Merge pull request #2713 from cpradio/master

Set focus on first item in drop down (textbox, link, whatever it may be)
This commit is contained in:
Robin Ward 2014-08-28 14:47:38 -04:00
commit a9de189682

View file

@ -58,7 +58,7 @@ export default Discourse.View.extend({
// fade it fast
$dropdown.fadeIn('fast');
// autofocus any text input field
$dropdown.find('input[type=text]').focus().select();
$dropdown.find('input[type=text],a:first').focus().select();
$html.on('click.d-dropdown', function(e) {
return $(e.target).closest('.d-dropdown').length > 0 ? true : hideDropdown.apply(self);