FS#32904 - {archweb} typeahead: set focus back after click

Attached to Project: Arch Linux
Opened by Marcel Korpel (Marcel-) - Thursday, 29 November 2012, 17:47 GMT
Last edited by Dan McGee (toofishes) - Saturday, 29 March 2014, 23:05 GMT
Task Type Feature Request
Category Web Sites
Status Closed
Assigned To Dan McGee (toofishes)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 2
Private No

Details

When you click an item in the typeahead box, #pkgsearch-field loses focus. Please set focus back after clicking so we can always just press enter to start the search after selecting an item (using keyboard and mouse).

Possible, quick-and-dirty, untested, not-so-nice solution:

diff --git a/sitestatic/bootstrap-typeahead.js b/sitestatic/bootstrap-typeahead.js
index 3d355ae..5bc24da 100644
--- a/sitestatic/bootstrap-typeahead.js
+++ b/sitestatic/bootstrap-typeahead.js
@@ -252,6 +252,7 @@
e.stopPropagation()
e.preventDefault()
this.select()
+ this.$element.focus()
}

, mouseenter: function (e) {
This task depends upon

Closed by  Dan McGee (toofishes)
Saturday, 29 March 2014, 23:05 GMT
Reason for closing:  Fixed
Additional comments about closing:  Fixed a different way.
Comment by Marcel Korpel (Marcel-) - Thursday, 29 November 2012, 17:50 GMT
Patch file included.
Comment by Evangelos Foutras (foutrelis) - Saturday, 01 December 2012, 12:08 GMT
Looks like there's a relevant feature request upstream:

https://github.com/twitter/bootstrap/issues/5933
Comment by Marcel Korpel (Marcel-) - Saturday, 22 December 2012, 11:05 GMT
My pull request has been merged into 2.3.0-wip and will be deployed in the next version:

https://github.com/twitter/bootstrap/pull/6099

Loading...