Ignore shift key for touch-enabled browsers

Firefox Mobile (née Fennec) has a bug that sets Event.shiftKey to true
even though the shift key is not depressed:

  https://bugzilla.mozilla.org/show_bug.cgi?id=694268

As a workaround, ignore whether the shift key is depressed for
touch-enabled browsers. This breaks Leaflet’s drag-zoom, but besides
being awkward I’m unsure it consistently worked on other touch-enabled
browsers (did not work for me on Android 2.3 devices w/ Bluetooth
keyboard).
This commit is contained in:
Samat K Jain 2011-10-14 17:16:13 -06:00
parent ac78c7e144
commit c59e8b3239

View File

@ -30,7 +30,7 @@ L.Draggable = L.Class.extend({
},
_onDown: function(e) {
if (e.shiftKey || ((e.which != 1) && (e.button != 1) && !e.touches)) { return; }
if ((!L.Browser.touch && e.shiftKey) || ((e.which != 1) && (e.button != 1) && !e.touches)) { return; }
if (e.touches && e.touches.length > 1) { return; }