Merge pull request #2302 from ivaynberg/issue_1541
Only disable keyboard focusing for touch devices
This commit is contained in:
commit
6b689fc4e0
@ -3387,6 +3387,15 @@ the specific language governing permissions and limitations under the Apache Lic
|
|||||||
searchInputPlaceholder: '',
|
searchInputPlaceholder: '',
|
||||||
createSearchChoicePosition: 'top',
|
createSearchChoicePosition: 'top',
|
||||||
shouldFocusInput: function (instance) {
|
shouldFocusInput: function (instance) {
|
||||||
|
// Attempt to detect touch devices
|
||||||
|
var supportsTouchEvents = (('ontouchstart' in window) ||
|
||||||
|
(navigator.msMaxTouchPoints > 0));
|
||||||
|
|
||||||
|
// Only devices which support touch events should be special cased
|
||||||
|
if (!supportsTouchEvents) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
// Never focus the input if search is disabled
|
// Never focus the input if search is disabled
|
||||||
if (instance.opts.minimumResultsForSearch < 0) {
|
if (instance.opts.minimumResultsForSearch < 0) {
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
Reference in New Issue
Block a user