Skip to content

Commit

Permalink
fix: ios devices do not trigger click events on 'non-clickable' eleme…
Browse files Browse the repository at this point in the history
…nts (#1634)

* Fix for issue #1503 -> ios devices do not trigger click events on 'non-clickable' elements

* Removed package-lock.json
  • Loading branch information
csteeg authored and marcosmoura committed Mar 28, 2018
1 parent 4bcedb8 commit 63b8ac0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/core/utils/MdObserveEvent.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 63b8ac0

Please sign in to comment.