From d78fb499435530f2d8178931084b716218adba42 Mon Sep 17 00:00:00 2001 From: Dag Jomar Mersland Date: Mon, 19 Aug 2013 10:14:36 +0200 Subject: [PATCH] Fix for iPad, where el.tagName was undefined when clicking on labels. --- src/dom/Draggable.js | 2 +- src/map/handler/Map.Tap.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dom/Draggable.js b/src/dom/Draggable.js index 59362978..48bb6cb0 100644 --- a/src/dom/Draggable.js +++ b/src/dom/Draggable.js @@ -62,7 +62,7 @@ L.Draggable = L.Class.extend({ el = first.target; // if touching a link, highlight it - if (L.Browser.touch && el.tagName.toLowerCase() === 'a') { + if (L.Browser.touch && el.tagName && el.tagName.toLowerCase() === 'a') { L.DomUtil.addClass(el, 'leaflet-active'); } diff --git a/src/map/handler/Map.Tap.js b/src/map/handler/Map.Tap.js index efd860e5..54dbb0f4 100644 --- a/src/map/handler/Map.Tap.js +++ b/src/map/handler/Map.Tap.js @@ -66,7 +66,7 @@ L.Map.Tap = L.Handler.extend({ var first = e.changedTouches[0], el = first.target; - if (el.tagName.toLowerCase() === 'a') { + if (el && el.tagName && el.tagName.toLowerCase() === 'a') { L.DomUtil.removeClass(el, 'leaflet-active'); }