mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-28 01:56:01 -05:00
Set focus on first item in drop down (textbox, link, whatever it may be)
Set focus on first item in the drop down for keyboard users, so they can quickly tab to the link/item of their choosing. https://meta.discourse.org/t/keyboard-shortcuts-wish-list/15952
This commit is contained in:
parent
fc71662a13
commit
a40b08f210
1 changed files with 1 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue