jquery-archive / jquery-mobile

jQuery Mobile Framework
https://jquerymobile.com
Other
9.7k stars 2.41k forks source link

Mobile Safari: Touch on link seemingly processes again after page transition. #1355

Closed mlitwin closed 13 years ago

mlitwin commented 13 years ago

New in A4. Touch on a link button to transition to a new page. If a link button on that new page is in the same location as the previous one, it's triggered. Seems to be mobile safari only, desktop safari doesn't show the behavior.

Tested on iOS 4.3 (simulator). Noticed the problem with PhoneGap, but happens without it. In the following code, click on "clickme" to see the behavior (the broken link on the next page is triggered). In this example the issue seems to happen only after the first load of the page. Hitting back, and trying again, it doesn't happen.

Example

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1">

    <title>test</title>

    <link rel="stylesheet" href="jquery.mobile-1.0a4/jquery.mobile-1.0a4.css" />    
    <script src="jquery-1.5.1.min.js"></script> 
    <script src="jquery.mobile-1.0a4/jquery.mobile-1.0a4.js"></script>

    <!-- <script type="text/javascript" charset="utf-8" src="phonegap.0.9.4.min.js"></script> -->

  </head>

<body> 

<!-- Start of first page -->
<div data-role="page" id="foo">

    <div data-role="header">
        <h1>Foo</h1>
    </div><!-- /header -->

    <div data-role="content">   
        <p><a href="#bar">clickme</a></p>   
    </div><!-- /content -->

    <div data-role="footer">
        <h4>Page Footer</h4>
    </div><!-- /header -->
</div><!-- /page -->

<!-- Start of second page -->
<div data-role="page" id="bar">

    <div data-role="header">
        <h1>Bar</h1>
    </div><!-- /header -->

    <div data-role="content">   
        <p><a href="#outis">Broken Link</a></p> 
    </div><!-- /content -->

    <div data-role="footer">
        <h4>Page Footer</h4>
    </div><!-- /header -->
</div><!-- /page -->
</body>

</html>
jblas commented 13 years ago

I checked in a fix for this see issue 1331:

https://github.com/jquery/jquery-mobile/issues/1331

for details.

mlitwin commented 13 years ago

Indeed you did - just verified it in the head (97db437373431c8a83eefc6b12ce74b4c29e279e).

Next time I'll check the latest code before logging a bug. You folks are moving fast - it's a pleasure to see the code come together. Much appreciated!