From 741c0cdbd78dd9ee1fdd1961e47e0063e1880a2c Mon Sep 17 00:00:00 2001 From: Norbert Renner Date: Mon, 17 Feb 2020 17:27:38 +0100 Subject: [PATCH] Check touch for event type instead of expand option (#255) --- src/control.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/control.js b/src/control.js index b51ce37e..94f10e4d 100644 --- a/src/control.js +++ b/src/control.js @@ -94,10 +94,10 @@ export var Geocoder = L.Control.extend({ }, this ); - } else if (L.Browser.touch && this.options.expand === 'touch') { + } else if (this.options.expand === 'touch') { L.DomEvent.addListener( container, - 'touchstart mousedown', + L.Browser.touch ? 'touchstart mousedown' : 'mousedown', function(e) { this._toggle(); e.preventDefault(); // mobile: clicking focuses the icon, so UI expands and immediately collapses