From 63b8ac07e44b2d8d5d02d0f7ba5b018cc54f77f9 Mon Sep 17 00:00:00 2001 From: Chris van de Steeg Date: Wed, 28 Mar 2018 18:26:56 +0200 Subject: [PATCH] fix: ios devices do not trigger click events on 'non-clickable' elements (#1634) * Fix for issue #1503 -> ios devices do not trigger click events on 'non-clickable' elements * Removed package-lock.json --- src/core/utils/MdObserveEvent.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/core/utils/MdObserveEvent.js b/src/core/utils/MdObserveEvent.js index 812d6af9b..584918ff0 100644 --- a/src/core/utils/MdObserveEvent.js +++ b/src/core/utils/MdObserveEvent.js @@ -2,7 +2,10 @@ export default (el, eventName, observerFn, options) => { function killObserver () { el.removeEventListener(eventName, observerFn) } - + + //fix click event for ios devices: https://stackoverflow.com/questions/3705937/document-click-not-working-correctly-on-iphone-jquery/17490775 + eventName && eventName.indexOf('click') >= 0 && /iP/i.test(navigator.userAgent) && (el.style.cursor = 'pointer'); + // el.addEventListener(eventName, observerFn, options || false) return {