Search code examples
javascriptdomios6

Touchstart event is not firing inside iframe iOS 6


I have a problem while selecting the text in IOS 6.The touchstart event is not firing inside an iframe while in iOS 6. On iOS 5 this is working fine.


Solution

  • I also had the same problem but only in some of my iframes. Why only some of them, I don't know.

    But I managed to get the event firing consistently in all of them by explicitly having an event listener on touchstart events in the context of the document containing the iframes.

    So adding the following code for the doc containing the iframe was the workaround for me.

    function dummy() {
        // console.log("A bug? Where?");
    }
    
    addEventListener("touchstart", dummy, false);