Dialog launched from footer breaks layout
Hi,
I have a button in my page's footer that opens a popup dialog. The problem is, whenever I close the dialog (click X on top left), the page layout breaks and elements have the wrong vertical position (they are moved up so top of page is inaccessible). For this bug to happen, the page must be tall enough to show a scrollbar.
This doesn't happen in desktop Firefox but happens in Android's browser (tested on my phone, and in Android Emulator 1.6-2.2).
EDIT: Just noticed it happens in Google Chrome, so you can easily test this on a desktop computer. Just make sure the window is small enough to show a scrollbar.
Anyone know a way around this?
Thanks.
Test code:
- <!DOCTYPE HTML>
- <html>
- <head>
- <title>Sears Rebate Finder</title>
- <link rel="stylesheet" href="http://code.jquery.com/mobile/1.0a4.1/jquery.mobile-1.0a4.1.min.css" />
- <script src="http://code.jquery.com/jquery-1.5.2.min.js"></script>
- <script src="http://code.jquery.com/mobile/1.0a4.1/jquery.mobile-1.0a4.1.min.js"></script>
- </head>
- <body>
- <div data-role="page" id="mypage">
- <div data-role="header">
- <h1>Top Header</h1>
- <a href="#email-dialog" data-rel="dialog">Email Popup 1 (works)!</a>
- </div>
-
- <div data-role="content" data-theme="d">
- <div>
- <ul id="cat-results-list" data-role="listview" data-theme="d" class="ui-grid-a">
- <li>List item...</li><li>List item...</li><li>List item...</li>
- <li>List item...</li><li>List item...</li><li>List item...</li>
- <li>List item...</li><li>List item...</li><li>List item...</li>
- <li>List item...</li><li>List item...</li><li>List item...</li>
- <li>List item...</li><li>List item...</li><li>List item...</li>
- </ul>
- </div>
-
- <p>
- Some more content text...
- </p>
- </div>
-
- <div data-role="footer">
- <h1>Bottom Header</h1>
- <a href="#email-dialog" data-rel="dialog">Email Popup 2 (doesn't)!</a>
- </div>
-
- </div>
-
- <div data-role="page" id="email-dialog">
- <div data-role="header">
- <h1>My Dialog</h1>
- </div>
- <div data-role="content" data-theme="d">
- Hi from dialog!
- </div>
- </div>
-
- </body>
- </html>